Skip to content

fix(desktop): batch staged-score updates - #9816

Merged
Git-on-my-level merged 2 commits into
mainfrom
fix/desktop-staged-score-batching
Jul 15, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
fix/desktop-staged-score-batching

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

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 500 and 1.

Verification

  • xcrun swift test --package-path Desktop --filter APIClient — 116 passed
  • make preflight with this PR body — passed

Product invariants affected

  • INV-AUTH-1

Review in cubic

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
Git-on-my-level merged commit f7d7654 into main Jul 15, 2026
19 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/desktop-staged-score-batching branch July 15, 2026 19:24
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]>
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.

macOS: batch staged-score updates at backend payload limit

1 participant