Skip to content

fix(boosty): cancel hourly refresh task when publisher stops - #37

Merged
k0te1ch merged 2 commits into
mainfrom
fix/boosty-refresh-task-shutdown
Aug 15, 2026
Merged

k0te1ch merged 2 commits into
mainfrom
fix/boosty-refresh-task-shutdown

Conversation

@k0te1ch

@k0te1ch k0te1ch commented Aug 15, 2026

Copy link
Copy Markdown
Owner

The Boosty publisher starts an hourly token-refresh task in run() and never
cancels it. When the consumer loop exits — cancelled from outside, or because
the consumer itself blew up — the task stays alive and keeps refreshing a
session nobody uses.

Cancel it in a finally block, swallowing the expected CancelledError.

Tests cover both exits: a failing consumer loop and a clean return. Note for
reviewers: the tests patch main.BasePublisher, not app.shared.publishers.base
— the publisher runs in-container with shared... on the path, so those are two
distinct module objects and patching the wrong one silently does nothing.

k0te1ch and others added 2 commits August 15, 2026 16:55
The refresh task was created in run() and never cancelled, so it outlived
the consumer loop and kept refreshing a session nobody used. Cancel it in
a finally block and add lifecycle tests for both clean and failing exits.
@k0te1ch
k0te1ch merged commit 3a7671c into main Aug 15, 2026
5 checks passed
@k0te1ch
k0te1ch deleted the fix/boosty-refresh-task-shutdown branch August 15, 2026 15:25
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