Skip to content

Google Sheets: buffer all rows and flush once per write() call#309

Open
Yostra wants to merge 11 commits intotx/nary-search-paginationfrom
sheet_brrr
Open

Google Sheets: buffer all rows and flush once per write() call#309
Yostra wants to merge 11 commits intotx/nary-search-paginationfrom
sheet_brrr

Conversation

@Yostra
Copy link
Copy Markdown
Collaborator

@Yostra Yostra commented Apr 17, 2026

Summary

Buffer all records and checkpoint messages during a single write() call, flushing once at the end instead of every N rows. Removes the batch_size config field from the Google Sheets destination schema.

  • Eliminates mid-stream flushes that caused Google Workspace quota exhaustion
  • Eliminates duplicate rows caused by partial-flush + retry interactions
  • State checkpoints are buffered and yielded only after their covering rows are persisted

Test plan

  • New single-flush write unit test suite: verifies single append call per stream, checkpoint ordering after flush, and multi-stream + global state ordering
  • Existing unit and integration tests updated to remove batch_size references
  • Lint, build & test CI green

@Yostra Yostra force-pushed the sheet_brrr branch 2 times, most recently from 2e7aaad to 4a6afba Compare April 18, 2026 00:24
@tonyxiao tonyxiao changed the base branch from v2 to main April 18, 2026 00:31
@Yostra Yostra marked this pull request as ready for review April 18, 2026 00:33
@tonyxiao tonyxiao changed the title Sheet Google Sheets: buffer all rows and flush once per write() call Apr 18, 2026
Comment thread packages/destination-google-sheets/src/index.ts Fixed
Comment thread packages/destination-google-sheets/src/index.ts Fixed
Comment thread packages/source-stripe/src/src-list-api.ts Dismissed
Comment thread apps/engine/src/lib/state-reducer.test.ts Dismissed
Comment thread packages/source-stripe/src/index.test.ts Dismissed
Comment thread packages/destination-google-sheets/src/index.ts Dismissed
`[google-sheets] write() error after ${Date.now() - writeStart}ms (records=${recordCount}, states=${stateCount}): ${err instanceof Error ? err.message : String(err)}`
)
} finally {
if (cancelled) {
@Yostra Yostra changed the base branch from main to tx/progress-on-nary April 20, 2026 17:27
@Yostra Yostra changed the base branch from tx/progress-on-nary to tx/nary-search-pagination April 20, 2026 17:28
@Yostra Yostra force-pushed the sheet_brrr branch 6 times, most recently from fb3fbfc to f60b0a9 Compare April 21, 2026 01:13
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.

1 participant