fix(webapp): a session cannot end before it starts (#1159) #1160

Merged
claude-bot merged 1 commit from fix/1159-session-end-before-start into main 2026-10-13 01:57:11 +00:00
Collaborator

Closes #1159.

A session rescheduled under 4.4.1 kept its old end time, so it could end weeks before it started: the calendar item was wrong, and the poller would have marked the session completed a minute after it began.

  • Repair migration (e1159a1b2c3d, data only): a series session with an end at or before its start gets start + the series length; any other gets its end cleared. Downgrade is a deliberate no-op.
  • Pencilled sessions: moving a tentative session's one time now moves its end by the same amount (the confirmed path already did, since 4.5.0).
  • Readers: the calendar feed, the invite, the in-app calendar link and the completion poller ignore an end that is not after the start.
  • Writes: an explicit end at or before the start is refused with 422 {"detail": "A session has to end after it starts."}.

No bot contract change.

Verified

On docker-test from the committed tree: the new test module plus the sessions, series, scheduling, calendar feed/invite and migration-head modules (164 passed); the poller's completion tests; alembic upgrade head / downgrade -1 / upgrade head on a real Postgres; ruff format and check; version sync and changelog checks; eslint and vitest for src/components/session.

Not run locally: the full backend and frontend suites, build, synthetic (left to CI).

Note for merging

Two other 4.5.1 branches (#1156, #1158) also add a migration. Whichever merges after this one needs its down_revision re-pointed and the head pin in tests/export/test_import_jobs_migration.py moved.

Prod's one affected row (session 14 of A Merry Band of Thieves) was corrected by hand on 12 Oct on the owner's say, after a backup.

🤖 Generated with Claude Code

Closes #1159. A session rescheduled under 4.4.1 kept its old end time, so it could end weeks before it started: the calendar item was wrong, and the poller would have marked the session completed a minute after it began. - **Repair migration** (`e1159a1b2c3d`, data only): a series session with an end at or before its start gets start + the series length; any other gets its end cleared. Downgrade is a deliberate no-op. - **Pencilled sessions**: moving a tentative session's one time now moves its end by the same amount (the confirmed path already did, since 4.5.0). - **Readers**: the calendar feed, the invite, the in-app calendar link and the completion poller ignore an end that is not after the start. - **Writes**: an explicit end at or before the start is refused with 422 `{"detail": "A session has to end after it starts."}`. No bot contract change. ## Verified On `docker-test` from the committed tree: the new test module plus the sessions, series, scheduling, calendar feed/invite and migration-head modules (164 passed); the poller's completion tests; `alembic upgrade head` / `downgrade -1` / `upgrade head` on a real Postgres; ruff format and check; version sync and changelog checks; eslint and vitest for `src/components/session`. Not run locally: the full backend and frontend suites, `build`, `synthetic` (left to CI). ## Note for merging Two other 4.5.1 branches (#1156, #1158) also add a migration. Whichever merges after this one needs its `down_revision` re-pointed and the head pin in `tests/export/test_import_jobs_migration.py` moved. Prod's one affected row (session 14 of A Merry Band of Thieves) was corrected by hand on 12 Oct on the owner's say, after a backup. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(webapp): a session cannot end before it starts (#1159)
All checks were successful
CI / Does this change touch the recording path? (pull_request) Successful in 34s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been skipped
CI / Backend lint (ruff) (pull_request) Successful in 52s
CI / Bot/backend version sync (pull_request) Successful in 51s
CI / Docker image build (pull_request) Successful in 57s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 1m4s
CI / Feedback site tests (pull_request) Successful in 1m15s
CI / Bot tests and audit (pull_request) Successful in 1m57s
CI / Frontend (shard 2/2) (pull_request) Successful in 8m57s
CI / Frontend (shard 1/2) (pull_request) Successful in 11m3s
CI / End-to-end journeys (phone) (pull_request) Successful in 16m51s
CI / End-to-end journeys (keyboard) (pull_request) Successful in 18m30s
CI / End-to-end journeys (desktop) (pull_request) Successful in 18m40s
CI / Backend migration, tests, and audit (pull_request) Successful in 33m22s
f275e21251
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude-bot deleted branch fix/1159-session-end-before-start 2026-10-13 01:57:11 +00:00
Sign in to join this conversation.
No description provided.