fix(schedule): limit to 24 hours ahead with a clear message (#275) #433

Merged
jared merged 1 commits from fix/schedule-24h into lotus 2026-10-19 16:28:35 -04:00
Owner

Fixes #275.

Production Synapse caps delayed events at max_event_delay_duration: 24h. The Schedule Message dialog only checked "at least 1 minute ahead", so any later date could be picked, and the user then saw the raw server error (The requested delay (172800000ms) exceeds the allowed maximum…).

  • MAX_SCHEDULE_AHEAD_MS (24 h) and SCHEDULE_TOO_FAR_TEXT live in utils/scheduledMessages.ts.
  • The date input has min = today and max = now + 24 h.
  • A too-late time shows "You can schedule up to 24 hours ahead." as soon as it's picked, and Schedule stays disabled. Moving back into range clears it. The "at least 1 minute" fallback no longer shows alongside it.
  • describeScheduleError() maps ORG.MATRIX.MSC4140_DELAY_TOO_LARGE to the same text, in case the server limit changes; other errors keep their message.

Verified

  • Unit test: the mapping and the 24 h value (13/13 in the file).
  • Browser: date min/max = 2026-10-19/2026-10-20. Picking 2026-10-21 shows the message at once, Schedule is disabled, and 0 requests reach the server. Back within 24 h, the message clears and Schedule enables.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #275. Production Synapse caps delayed events at `max_event_delay_duration: 24h`. The Schedule Message dialog only checked "at least 1 minute ahead", so any later date could be picked, and the user then saw the raw server error (`The requested delay (172800000ms) exceeds the allowed maximum…`). - `MAX_SCHEDULE_AHEAD_MS` (24 h) and `SCHEDULE_TOO_FAR_TEXT` live in `utils/scheduledMessages.ts`. - The date input has `min` = today and `max` = now + 24 h. - A too-late time shows **"You can schedule up to 24 hours ahead."** as soon as it's picked, and Schedule stays disabled. Moving back into range clears it. The "at least 1 minute" fallback no longer shows alongside it. - `describeScheduleError()` maps `ORG.MATRIX.MSC4140_DELAY_TOO_LARGE` to the same text, in case the server limit changes; other errors keep their message. **Verified** - Unit test: the mapping and the 24 h value (13/13 in the file). - Browser: date `min`/`max` = `2026-10-19`/`2026-10-20`. Picking 2026-10-21 shows the message at once, Schedule is disabled, and **0 requests reach the server**. Back within 24 h, the message clears and Schedule enables. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-19 15:20:12 -04:00
fix(schedule): limit to 24 hours ahead with a clear message (#275)
CI / Build & Quality Checks (pull_request) Successful in 1m43s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 7s
CI / Playwright smoke (e2e) (pull_request) Successful in 13m4s
d223f847c6
Production Synapse caps delayed events at 24h, but the dialog let any
later time be picked and then showed the raw server error. The date
input now has min/max (today .. now+24h), a too-late time shows "You can
schedule up to 24 hours ahead." as soon as it is picked (and blocks
Schedule), and ORG.MATRIX.MSC4140_DELAY_TOO_LARGE maps to the same text.

Fixes #275

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit 8ea03ab9b6 into lotus 2026-10-19 16:28:35 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#433