Skip to content

Move the running podcast sources to fifteen minutes - #35

Merged
ralyodio merged 1 commit into
mainfrom
podcasts-cadence-migration
Sep 9, 2026
Merged

Move the running podcast sources to fifteen minutes#35
ralyodio merged 1 commit into
mainfrom
podcasts-cadence-migration

Conversation

@ralyodio

@ralyodio ralyodio commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

#34 set cadenceMinutes: 15 on the adapter. That decides what a source is created with and nothing else — so it reached exactly nothing that was already running.

insertSource is idempotent on the slug, and its conflict clause updates name, description and updated_at. Not config, and not cadence_minutes. That is deliberate: cadence is on the list of things an operator may edit from the sources page, so re-asserting the adapter's number on every boot would silently undo a human's decision the next time the web app restarted.

The cost of that is this migration. Both podcast sources were created while the adapter still said 60, so they kept 60. Nothing failed and no run errored — the catalogue walk simply proceeded at a quarter of the intended rate, which is the kind of wrong that is only visible if you go and look. Found by checking, not by anything reporting it.

Two properties, both asserted

  • Scoped by slug, not by adapter. A source somebody added themselves against the same adapter keeps the cadence they chose.
  • Conditional on the value still being 60. Re-running never walks a later decision back.

The test seeds an operator-tuned source (5 min) and a hand-made one alongside the two seeded ones, checks neither moves, then re-runs the statement against deliberately changed values to confirm it does not stomp them.

What needed no migration

backfillPages. Run config is { ...adapter.defaults, ...stored }, so a key the stored config has never carried resolves to the adapter's default on every run. The backfill was always going to work; only the rate was wrong.

  • 504 tests pass (1 new)
  • biome clean
  • migration applies against the in-process Postgres the schema suite runs

🤖 Generated with Claude Code

https://claude.ai/code/session_0166srGNRGyeDQbQnJpbNPNb

#34 set `cadenceMinutes: 15` on the adapter, which decides what a source is
created with and nothing else. `insertSource` is idempotent on the slug and its
conflict clause updates name, description and updated_at -- not config, and not
cadence_minutes. That is deliberate: cadence is on the list of things an
operator may edit from the sources page, so re-asserting the adapter's number
on every boot would silently undo a human's decision the next time the web app
restarted.

The cost of that is this migration. Both podcast sources were created while the
adapter still said 60, so they kept 60, and #34 reached exactly nothing that was
already running. Nothing failed and no run errored -- the catalogue walk simply
proceeded at a quarter of the intended rate, which is the kind of wrong that is
only visible if you go and look. Found by checking rather than by anything
reporting it.

Scoped by slug rather than by adapter, so a source somebody added themselves
keeps the cadence they chose, and conditional on the value still being 60, so
re-running never overwrites a later decision. Both properties are asserted:
the test seeds an operator-tuned source and a hand-made one alongside the two
seeded ones and checks neither moves, then re-runs the statement against
deliberately changed values.

`backfillPages` needed no such treatment -- run config is `{ ...adapter.defaults,
...stored }`, so a key the stored config has never carried resolves to the
adapter's default on every run.

504 tests pass, biome clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0166srGNRGyeDQbQnJpbNPNb
@ralyodio
ralyodio merged commit 025d0f6 into main Sep 9, 2026
3 checks passed
@ralyodio
ralyodio deleted the podcasts-cadence-migration branch September 9, 2026 14:05
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