Skip to content

Fix invalid retry-after header - #737

Open
flyerhzm wants to merge 2 commits into
rpush:masterfrom
PlatphormCorp:features/fix-invalid-retry-after-header
Open

Fix invalid retry-after header#737
flyerhzm wants to merge 2 commits into
rpush:masterfrom
PlatphormCorp:features/fix-invalid-retry-after-header

Conversation

@flyerhzm

Copy link
Copy Markdown

We’re seeing some invalid retry-after values, such as -1 or -2, for WebPush, which is causing the following error.

Error type: ArgumentError
Error message: not RFC 2616 compliant date: "-1"
Where:
Occurred at: Mar 21, 2025 04:26:42 UTC
First seen at: Nov 12, 2024 21:51:53 UTC
Occurrences: 170 (0 since last deploy on )
Severity: error

URL:
File: /GEM_ROOT/gems/time-0.3.0/lib/time.rb

Backtrace:
/GEM_ROOT/gems/time-0.3.0/lib/time.rb:599:in httpdate /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/retry_header_parser.rb:18:in parse /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/retry_header_parser.rb:5:in parse /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:94:in deliver_after_header /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:78:in retry_delivery /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:71:in process_response /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:35:in perform /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher/http.rb:12:in dispatch /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:66:in dispatch /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:35:in block (2 levels) in start /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:25:in loop /GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:25:in block in start

We’re seeing some invalid retry-after values, such as -1 or -2, for WebPush,
which is causing the following error.

Error type: ArgumentError
Error message: not RFC 2616 compliant date: "-1"
Where: <no information>
Occurred at: Mar 21, 2025 04:26:42 UTC
First seen at: Nov 12, 2024 21:51:53 UTC
Occurrences: 170 (0 since last deploy on <no information>)
Severity: error

URL: <no information>
File: /GEM_ROOT/gems/time-0.3.0/lib/time.rb

Backtrace:
/GEM_ROOT/gems/time-0.3.0/lib/time.rb:599:in httpdate
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/retry_header_parser.rb:18:in parse
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/retry_header_parser.rb:5:in parse
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:94:in deliver_after_header
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:78:in retry_delivery
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:71:in process_response
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/webpush/delivery.rb:35:in perform
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher/http.rb:12:in dispatch
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:66:in dispatch
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:35:in block (2 levels) in start
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:25:in loop
/GEM_ROOT/bundler/gems/rpush-4ab018597541/lib/rpush/daemon/dispatcher_loop.rb:25:in block in start
@benlangfeld

Copy link
Copy Markdown
Collaborator

Would you please write a changelog entry and a test for this?

@flyerhzm
flyerhzm force-pushed the features/fix-invalid-retry-after-header branch from aaec917 to 9739e74 Compare July 7, 2025 07:41
@flyerhzm

flyerhzm commented Jul 7, 2025

Copy link
Copy Markdown
Author

@benlangfeld I’ve added a test for this.

Regarding the changelog, our version is a bit behind, so I can’t update CHANGELOG.md directly. Please add the following entry manually, thanks!

- Fix invalid retry-after header [\#737](https://github.com/rpush/rpush/pull/737) ([flyerhzm](https://github.com/flyerhzm))

@benlangfeld

Copy link
Copy Markdown
Collaborator

@benlangfeld I’ve added a test for this.

Regarding the changelog, our version is a bit behind, so I can’t update CHANGELOG.md directly. Please add the following entry manually, thanks!


- Fix invalid retry-after header [\#737](https://github.com/rpush/rpush/pull/737) ([flyerhzm](https://github.com/flyerhzm))

You will need to merge the master branch into yours.

@bettysteger

Copy link
Copy Markdown
Contributor

i just got the same error, will this be fixed?

ArgumentError
not RFC 2616 compliant date: "-1" (ArgumentError)

        raise ArgumentError.new("not RFC 2616 compliant date: #{date.inspect}")

rpush (9.2.0) lib/rpush/daemon/retry_header_parser.rb in parse at line 18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants