Skip to content

feat(google): parse partial-failure details into accurate accept/reject counts#8

Merged
NagaYu merged 1 commit into
mainfrom
feat/google-partial-failure-counts
Jun 28, 2026
Merged

feat(google): parse partial-failure details into accurate accept/reject counts#8
NagaYu merged 1 commit into
mainfrom
feat/google-partial-failure-counts

Conversation

@NagaYu

@NagaYu NagaYu commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Resolves #3.

What

  • New pure helper countFailedOperations(partialFailureError, batchSize) parses Google's details[].errors[].location.fieldPathElements to count distinct rejected operations indices.
  • uploadToGoogle now sets recordsAccepted/recordsRejected from the real split instead of counting the whole batch as accepted.
  • Expanded GoogleAddOperationsResponse types with the partial-failure detail shape.

Tests

  • New test/sync.test.ts: chunk() + countFailedOperations() (dedup of repeated errors, ignores non-operation field paths, caps at batch size).
  • 34/34 tests pass; typecheck, lint, format, build all green locally.

…ct counts

uploadToGoogle previously counted an entire batch as accepted even when
Google returned a partialFailureError. Now a pure countFailedOperations()
helper parses partialFailureError.details[].errors[].location.fieldPathElements
to count the distinct rejected `operations` indices, and the batch's
recordsAccepted/recordsRejected reflect the true split.

Adds test/sync.test.ts covering chunk() and countFailedOperations()
(dedup, non-operation paths ignored, batch-size cap).

Closes #3

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NagaYu NagaYu merged commit 12df548 into main Jun 28, 2026
3 checks passed
@NagaYu NagaYu deleted the feat/google-partial-failure-counts branch June 28, 2026 11:17
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.

Parse partial-failure details from Google addOperations response

1 participant