fix(config): cap renew_hours at the documented 24-hour rule - #6
Conversation
Dave Winer's walkthrough (http://walkthrough.rsscloud.co/) states that subscriptions expire after 25 hours and must be renewed every 24, so any renewal interval above 24 guarantees a lapse. The form offered up to 168. Clamp on the read path in renewSeconds() rather than only in the form: the max attribute is browser-side only, so a POST or a hand-edited configuration could store 168 regardless. configure.phtml renders the field from that same accessor, so an already-stored 168 now both behaves as and displays 24. Also corrects the comments and help text claiming the protocol documentation does not state an expiry, and that ~24 hours was merely a convention among implementations. It is documented. 23 remains the default: an hour inside the renewal requirement, two hours before expiry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 27 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
Per Dave's walkthrough, rssCloud subscriptions expire after 25
hours and must be renewed every 24. The
renew_hoursfield offered values up to 168 — aweek — so any setting above 24 silently guaranteed lapsed subscriptions.
This also corrects a factual error in the code:
extension.phpclaimed "the protocol documentationdoes not state an expiry" and that ~24 hours was "the convention among implementations." It is
documented; 23 was a better default than its own comment gave it credit for.
What
The cap is enforced on the read path, not just the form.
max="24"is browser-side only — aPOST or a hand-edited
configuration.phpcould still store 168. Clamping inrenewSeconds()coversevery route in, and because
configure.phtmlrenders the field from that same accessor, analready-stored 168 both behaves as and displays 24 with no migration.
The form's
maxnow readsRssCloudExtension::MAX_RENEW_HOURSinstead of a second hardcodedliteral, so the bound and the field cannot drift apart.
Corrected in all three places the wrong claim appeared —
extension.php,RssCloud/Subscriber.phpand
i18n/en/ext.php(the only locale).Margin, now that the numbers are real
Renewal fires at 23h, expiry at 25h, leaving a 2-hour window. Renewals are capped at
MAX_SUBSCRIPTIONS_PER_RUN = 10per actualize run, andonFeedsListBeforeActualizesees every feedon every run —
listFeedsOrderUpdate(-1)skips theWHEREclause, andactualize_script.phpsetsmaxFeeds = PHP_INT_MAX. Since Docker'sCRON_MINonly replaces the minute field, any non-emptyvalue gives at least one run per hour, so ≥20 renewals fit in the window. Lapsing would take 20+
subscriptions falling due simultaneously.
MAX_SUBSCRIPTIONS_PER_RUNleft alone.Verification
php -lover php+phtml clean · PHPStan level 10[OK] No errors· phpcs 10/10 files clean ·clamp behaviour checked across the input range above.
No test suite exists here, so this is static analysis plus a direct check of the clamp arithmetic —
nothing exercises the config screen end to end.
🤖 Generated with Claude Code