fix(sync,web): surface exhausted jobs and skip draft compass hop - #2522
Merged
Conversation
Expose exhausted failed Sync jobs in diagnostics, sweep logs, and a manage-failed-jobs CLI so operators can clear or requeue wedged work. Project Week grid drafts straight to GridEvent without a CompassEvent bridge. Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Use a true exhausted count with truncation signal on list, reject clear on non-failed jobs, and check remove success. Share the exhausted-job Mongo filter between count/list helpers. Co-authored-by: Tyler Dane <tyler-dane@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.
Summary
Surfaces Sync jobs that exhausted the self-heal requeue budget so operators can find and clear/requeue wedged work, and removes the unnecessary CompassEvent hop on the Week draft render path.
failedJobCount/exhaustedJobCountbun run cli manage-failed-jobs list|clear|requeueDraft/GridDraftprojectGridEventDraft → GridEventdirectlySimplicity
Shared the exhausted-job Mongo filter between count/list helpers. CLI
listreports true count + truncation rather than treating the sample length as the total. No new React state/effects.Automated validation
bun run type-checkandbun run lint(pass)Independent review
Fresh diff review confirmed three CLI issues; all fixed before merge:
listunder-reported when sample capped — now usescountExhaustedFailed+truncatedclearcould delete non-failed jobs — now requiresstate === "failed"clear --applyignoredremove()failure — now throws on falseNo confirmed defects on the draft → GridEvent projection path.
Test plan
bun packages/scripts/src/testing/test-mongo-env.ts sync -- packages/sync/src/storage/repositories/job.repository.db.test.ts packages/sync/src/domain/failed-job-requeue.service.db.test.ts packages/sync/src/server/diagnostic.routes.db.test.tsbun test packages/core/src/types/sync/diagnostic.contracts.test.tsbun packages/scripts/src/testing/test-parallel.ts web -- packages/web/src/events/grid-event-draft.adapter.test.ts packages/web/src/views/Week/components/Draft/grid/GridDraft.test.tsx packages/web/src/grid/layout/all-day-draft.position.test.tsbun run type-checkbun run lint