Skip to content

Conversation

@sl0thentr0py
Copy link
Member

@linear
Copy link

linear bot commented Oct 20, 2025

private

def read_data_from(request)
return "Skipped non-rewindable request body" unless request.body.respond_to?(:rewind)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Form Data Request Handling Bug

The early request.body.respond_to?(:rewind) check incorrectly skips form data requests that don't require rewinding. It also changes the return value from nil to a "Skipped non-rewindable request body" string when request.body is nil, affecting RequestInterface.data for empty bodies.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they do require rewinding, it's implicit currently

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: I feel a symbol might be cleaner than returning a string, or even a constant with the symbol as value 🤷 and is this something that's worth logging with sdk_logger at debug level, or is that too much?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will surface in the product it's part of the payload so they can add the rewindable middleware if they want to fix it

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (6.0-dev@d9034a0). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             6.0-dev    #2754   +/-   ##
==========================================
  Coverage           ?   97.22%           
==========================================
  Files              ?      130           
  Lines              ?     5217           
  Branches           ?        0           
==========================================
  Hits               ?     5072           
  Misses             ?      145           
  Partials           ?        0           
Components Coverage Δ
sentry-ruby 97.51% <0.00%> (?)
sentry-rails 96.74% <0.00%> (?)
sentry-sidekiq 95.05% <0.00%> (?)
sentry-resque 94.44% <0.00%> (?)
sentry-delayed_job 94.68% <0.00%> (?)
sentry-opentelemetry 99.31% <0.00%> (?)
Files with missing lines Coverage Δ
sentry-ruby/lib/sentry/interfaces/request.rb 95.16% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sl0thentr0py sl0thentr0py merged commit b92b953 into 6.0-dev Oct 20, 2025
226 of 227 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/rack-3-rewind branch October 20, 2025 15:37
sl0thentr0py added a commit that referenced this pull request Oct 22, 2025
* Drop `async` configuration (#1894)

* Migrate from to_hash to to_h (#2351)

* Migrate from to_hash to to_h

As @solnic pointed out in #2350 (comment)
`to_hash` has special meaning in Ruby and could be called implicitly
in contexts like double splatting argument. So we should switch to `to_h`
to avoid potential issues.

* Fix specs after rebase

* Add before_send_check_in (#2703)

* Cleanup before_send to only apply to ErrorEvent
* remove the Hash deprecation message

* Archive sentry-raven (#2708)

Moved to https://github.com/getsentry/raven-ruby

* Remove stacktrace trimming from the SDK (#2714)

* Default config.enabled_environments to nil instead of [] (#2716)

* Remove :monotonic_active_support_logger (#2717)

* Add `config.trace_ignore_status_codes` to control which status codes don't get traced (#2725)

* Add config.trace_ignore_status_codes to control which status codes don't
get traced

* Change implementation to Range

* Don't send  client reports for profiles if profiling is disabled (#2728)

* Remove  and  and all metrics related code (#2729)

* Remove deprecated `config.capture_exception_frame_locals` (#2730)

* Remove deprecated capture_exception_frame_locals

* Remove deprecated config.enable_tracing (#2731)

* Remove deprecated config.enable_tracing

* Remove deprecated `config.logger` (#2732)

* Remove deprecated config.logger

* Remove deprecated Sentry::Rails::Tracing::ActionControllerSubscriber (#2733)

* Remove Transaction deprecations (#2736)

* Remove deprecated Event#configuration (#2740)

* Remove deprecated client methods (#2741)

* Bump required_ruby_version to 2.7 (#2743)

* Bump minimum rails version in `sentry-rails` to `5.2.0`
* Bump minimum sidekiq version in `sentry-sidekiq` to `5.0`
* Cleanup CI

* Remove hub from Transaction#initialize (#2739)

* Move examples out of SDK (#2746)

available at https://github.com/getsentry/examples/tree/master/ruby

* Add new config.profiles_sample_interval (#2745)

* Always set up the StructuredLogger and no-op capture_log_event if logs (#2752)

are disabled

* Make request body reading safe to rewind (#2754)

* Bump oversized stacktrace trunction to 500 on both sides

Revert "Remove stacktrace trimming from the SDK (#2714)"

This reverts commit ed7a2db.

---------

Co-authored-by: Stan Lo <stan001212@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants