fix: make long-history submission merges bounded - #94
Open
chsong1 wants to merge 1 commit into
Open
Conversation
|
@chsong1 is attempting to deploy a commit to the sculpt Team on Vercel. A member of the Team first needs to authorize it. |
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
Fixes #93.
Long-history re-submissions no longer perform one sequential
daily_breakdownswrite per day or race those uncancelled writes against a 25-second application timer. A 270-day merge now performs one conflict-safe bulk upsert, so the API does not report failure while the same submission continues and commits in the background.This includes the timeout-response correction from #80 and fixes the underlying O(days) merge that triggers it.
Changes
upserton the existing(submission_id, date)unique keymergeMachineContributionPromise.racethat could return a false failure after writes continuedtimeoutandtimed outdatabase error spellings as 504Verification
pnpm testβ passDatabase operation timed outmaps to 504node test/ccusage.test.mts /Users/chsong/cc.json && node --import tsx test/submissions.test.mtsβ pass against the real 270-day, 205,565,284,264-token payload from Submit reports generic 500 after long-history merge already committedΒ #93 (37 ccusage checks plus merge-path checks)pnpm buildβ application compiled successfully; page-data collection then stopped because the local checkout has noGITHUB_ID,GITHUB_SECRET,NEXTAUTH_SECRET, orNEXTAUTH_URLNotes
The bulk upsert relies on the existing unique constraint; no schema migration is required. It removes the observed timeout mechanism but does not attempt to redesign cross-request transaction/concurrency semantics, which predate this change.