Repository navigation
fix(desktop): batch staged-score updates - #9816
Merged
Merged
Conversation
Split staged-score updates into ordered 500-item requests to match the backend payload cap while preserving fail-fast request behavior. Tests: xcrun swift test --package-path Desktop --filter APIClient
Git-on-my-level
added a commit
that referenced
this pull request
Jul 16, 2026
…seline The APIClient.swift line-count ratchet in test_desktop_rest_inventory.py was capped at 6500 but the file grew to 6502 lines after the staged-score- update batch (#9816). The newer product-file-line-count ratchet (#9851) already baselines APIClient.swift at 6502. This updates the stale constant to match, unblocking the Backend unit suite which was failing on every open PR (including #9844 which does not touch any Swift files).
cursor Bot
pushed a commit
that referenced
this pull request
Jul 16, 2026
Kept origin/main's documented 6502 baseline comment (PR #9851 / #9816). Both sides already agreed on APICLIENT_SWIFT_MAX_LINES=6502. Verification: backend/.venv/bin/python -m pytest -q tests/unit/test_backend_test_runner.py tests/unit/test_desktop_rest_inventory.py::test_apiclient_swift_line_count_ratchet (5 passed) Co-authored-by: David Zhang <[email protected]>
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 #9814.
Desktop could score thousands of staged tasks but sent them in one request even though the backend contract accepts at most 500 scores. This splits score updates into ordered, sequential batches of at most 500 while retaining fail-fast behavior.
Root cause and durable guard
The authoritative API-client boundary did not enforce the server payload limit. A URLSession-backed regression test sends 501 scores and verifies two ordered PATCH requests with payload sizes
500and1.Verification
xcrun swift test --package-path Desktop --filter APIClient— 116 passedmake preflightwith this PR body — passedProduct invariants affected