Skip to content

fix(config): cap renew_hours at the documented 24-hour rule - #6

Merged
andrewshell merged 1 commit into
mainfrom
fix/lease-expiry-per-spec
Aug 5, 2026
Merged

fix(config): cap renew_hours at the documented 24-hour rule#6
andrewshell merged 1 commit into
mainfrom
fix/lease-expiry-per-spec

Conversation

@andrewshell

Copy link
Copy Markdown
Contributor

Why

Per Dave's walkthrough, rssCloud subscriptions expire after 25
hours
and must be renewed every 24. The renew_hours field offered values up to 168 — a
week — so any setting above 24 silently guaranteed lapsed subscriptions.

This also corrects a factual error in the code: extension.php claimed "the protocol documentation
does 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 — a
POST or a hand-edited configuration.php could still store 168. Clamping in renewSeconds() covers
every route in, and because configure.phtml renders the field from that same accessor, an
already-stored 168 both behaves as and displays 24 with no migration.

stored=NULL -> 23h    stored=24   -> 24h
stored=0    ->  1h    stored=25   -> 24h
stored=23   -> 23h    stored=168  -> 24h

The form's max now reads RssCloudExtension::MAX_RENEW_HOURS instead of a second hardcoded
literal, so the bound and the field cannot drift apart.

Corrected in all three places the wrong claim appeared — extension.php, RssCloud/Subscriber.php
and 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 = 10 per actualize run, and onFeedsListBeforeActualize sees every feed
on every run — listFeedsOrderUpdate(-1) skips the WHERE clause, and actualize_script.php sets
maxFeeds = PHP_INT_MAX. Since Docker's CRON_MIN only replaces the minute field, any non-empty
value 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_RUN left alone.

Verification

php -l over 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

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>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@andrewshell, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af38cf40-8fcc-421e-b11c-475d0734c20e

📥 Commits

Reviewing files that changed from the base of the PR and between d9c77c1 and 9a1a9bc.

📒 Files selected for processing (4)
  • RssCloud/Subscriber.php
  • configure.phtml
  • extension.php
  • i18n/en/ext.php

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@andrewshell
andrewshell merged commit 93f694e into main Aug 5, 2026
4 checks passed
@andrewshell
andrewshell deleted the fix/lease-expiry-per-spec branch August 5, 2026 22:44
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