Skip to content

Fold a mid-run refresh into the run instead of re-enqueueing it - #828

Merged
zakius merged 5 commits into
stagingfrom
fix/813-follow-up-inside-run
Sep 12, 2026
Merged

zakius merged 5 commits into
stagingfrom
fix/813-follow-up-inside-run

Conversation

@zakius

@zakius zakius commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Two fixes found reviewing #827, plus main's tip merged in so #827 can merge.

The #813 follow-up refresh never ran

runPendingRefresh called enqueueSource from inside the processor. At
that point BullMQ still holds ParseSource-<id> as active, so
enqueueSource took its own active branch and wrote the pending marker
straight back instead of queueing anything. The marker ping-ponged
between take and re-write, and the content still waited for the next poll
-- for a verified websub source, up to a day. That is the exact symptom
the issue is about.

The comment claimed "the job's id is free by the time this runs", which
is not true inside the processor: the id is released when the processor
returns. So the run answers the requests itself -- take the marker, parse
once more with the flags they asked for. A deferral or a failure leaves
the marker for the next run, as before.

The unit test stubbed enqueueSource out entirely, so it could not see
this. It now pins the two parses and asserts the enqueuer is not called.

This also drops a dead branch: parseSource only rethrows
HttpDeferredError, so the non-deferred catch never ran.

Re-registration mailed a token it had not stored yet

The #810 recovery path awaited sendActivationEmail before
refreshActivationToken. A failed write mailed a token the row never
took, putting the address back in the dead end it just asked to leave,
one throttle slot poorer. Write first.

🤖 Generated with Claude Code

zakius and others added 5 commits September 9, 2026 08:39
Merge staging into main: mobile layout setting
Brings staging up to main's tip so the release PR can merge (#827).
The follow-up refresh #813 promises never ran. runPendingRefresh called
enqueueSource from inside the processor, where BullMQ still holds
ParseSource-<id> as active -- so enqueueSource took its own active branch
and wrote the pending marker straight back instead of queueing anything.
The marker ping-ponged and the content still waited for the next poll,
which for a verified websub source is up to a day: the exact symptom the
issue is about. The unit test could not see it, stubbing enqueueSource
out entirely.

The id cannot be free until the processor returns, so the run answers
the requests itself: take the marker, parse once more with the flags
they asked for. A deferral or a failure leaves the marker for the next
run, as before. This also drops a dead branch -- parseSource only
rethrows HttpDeferredError, so the non-deferred catch never ran.

Also: the re-registration path stored its fresh activation token after
mailing it, so a failed write mailed a token the row never took and put
the address back in the dead end #810 fixes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@zakius
zakius merged commit 53eeeef into staging Sep 12, 2026
18 checks passed
@zakius
zakius deleted the fix/813-follow-up-inside-run branch September 12, 2026 20:07
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