Skip to content

Fix connection errors during body reads#964

Merged
rgalanakis merged 1 commit intomainfrom
icalendar-body-read-error
Jun 8, 2025
Merged

Fix connection errors during body reads#964
rgalanakis merged 1 commit intomainfrom
icalendar-body-read-error

Conversation

@rgalanakis
Copy link
Contributor

For a long time, we've been plagued by errors in Sentry due to errors when reading an HTTP body (not on the initial connection).

Now that we have an in-process http server for testing, I was able to reproduce this problem using some rack hijacking. This also meant removing Thin for Puma (thin doesn't support rack.hijack).

The fix was sort of obvious- wrapping the body-reading portion of the code in the same sort of exception handling that the initial connection uses.

Refactor the in-process http server into a spec helper module so it can be reused elsewhere.

@rgalanakis rgalanakis force-pushed the icalendar-body-read-error branch from 4128634 to 56a2d6d Compare June 8, 2025 06:56
For a long time, we've been plagued by errors in Sentry due to
errors when reading an HTTP body (not on the initial connection).

Now that we have an in-process http server for testing,
I was able to reproduce this problem using some rack hijacking.
This also meant removing Thin for Puma (thin doesn't support
rack.hijack).

The fix was sort of obvious- wrapping the body-reading portion
of the code in the same sort of exception handling
that the initial connection uses.

Refactor the in-process http server into a spec helper module
so it can be reused elsewhere.
@rgalanakis rgalanakis force-pushed the icalendar-body-read-error branch from 56a2d6d to 636d52a Compare June 8, 2025 15:36
@codecov
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.08%. Comparing base (b316a33) to head (636d52a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #964      +/-   ##
==========================================
+ Coverage   97.03%   97.08%   +0.04%     
==========================================
  Files         487      488       +1     
  Lines       30994    31035      +41     
==========================================
+ Hits        30076    30129      +53     
+ Misses        918      906      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@rgalanakis rgalanakis merged commit 749e491 into main Jun 8, 2025
4 checks passed
@rgalanakis rgalanakis deleted the icalendar-body-read-error branch June 8, 2025 15:42
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.

1 participant