Skip to content

feat(google-sheets): expose pending row count before flush - #960

Merged
YusukeHirao merged 3 commits into
devfrom
fix/google-sheets-flush-progress
Sep 1, 2026
Merged

feat(google-sheets): expose pending row count before flush#960
YusukeHirao merged 3 commits into
devfrom
fix/google-sheets-flush-progress

Conversation

@YusukeHirao

Copy link
Copy Markdown
Member

Summary

  • Sheet#onProgress only fires after a chunk's batchUpdate resolves, so callers had no way to
    show anything while the final buffered chunk (below the 2500-row auto-flush threshold) was in
    flight — the send just sits there silently until it completes.
  • Add a pendingCount getter that exposes the number of buffered-but-unsent rows, so a caller can
    report how many rows are about to be sent right before calling flush().

Consumer

nitpicker's create-sheets.ts (Insert rows: <name> step) will use sheet.pendingCount to show a
"flushing N rows..." message before its final sheet.flush() call, once this package is published.
That change is tracked separately and depends on this package's release.

Test plan

  • yarn test (2047 tests, all passing) — added coverage for the threshold boundary, the
    post-auto-flush remainder, flush() draining to 0, lazy-row buffering past
    SEND_CHUNK_SIZE, and [Symbol.asyncDispose] draining to 0
  • yarn build
  • yarn lint (0 errors)

Sheet#onProgress only fires after a chunk's batchUpdate resolves, so
callers had no way to show anything while the final buffered chunk
was in flight. Add a pendingCount getter so callers can report how
many rows are about to be sent right before calling flush().
Cover the JSDoc claim that pendingCount reflects rows held past
SEND_CHUNK_SIZE while a lazy row suspends auto-flush, and add the
@example the project's public-API JSDoc convention requires.
Complete the state-transition coverage for pendingCount alongside the
existing sentCount coverage for the same [Symbol.asyncDispose] path.
@YusukeHirao
YusukeHirao merged commit ef4c2ff into dev Sep 1, 2026
7 checks passed
@YusukeHirao
YusukeHirao deleted the fix/google-sheets-flush-progress branch September 1, 2026 09:37
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