fix(workflow): close scheduler and projection gaps - #4901
Draft
clearmud wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Clearmud <220869990+clearmud@users.noreply.github.com> Signed-off-by: Clearmud <220869990+clearmud@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Root cause
The cron loop sleeps for 60 seconds and previously looked back exactly 60 seconds using an exclusive lower bound. Database and workflow work between sleeps could move the next scan just past that window, permanently missing a scheduled instant.
Workflow definition ingest also committed the registry row separately from the signed kind-30620 event consumed by Desktop. A commit failure could therefore leave a runnable workflow that was invisible in the Workflows UI.
Impact
Scheduled workflows tolerate normal tick drift without duplicate execution because existing durable
(community_id, workflow_id, scheduled_for)claims deduplicate the overlapping scan window. Workflow registry and Desktop projection state can no longer diverge at ingest.Validation
cargo fmt --all -- --checkcargo test -p buzz-workflow— 155 passed, 0 failed, 2 ignoredcargo test -p buzz-db --lib— 94 passed, 0 failed, 155 ignoredcargo clippy -p buzz-workflow -p buzz-db -p buzz-relay --all-targets -- -D warningscargo test -p buzz-relay --lib— 830 passed, 9 failed, 38 ignored; the 9 existing failures require a configured local Postgres service (PoolTimedOut) and do not touch the workflow paths