fix(record-hook): complete commits after updating records when trackChanges is enabled #872
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 a bug where
bulkRecordHookwould not complete commits when records were modified andtrackChangeswas enabled. This caused thecommit:completedevent to never fire, blocking workflows that depend on commit completion.Root Cause: The plugin only called
completeCommit()in three cases:But in the "happy path" where records ARE modified, it called
event.update(modifiedRecords)without subsequently callingcompleteCommit(), leaving commits incomplete indefinitely.The Fix: Added
await completeCommit(event, debug)after successfully updating modified records (line 133).Please explain how to summarize this PR for the Changelog:
Fixed bug where commits were never completed when bulkRecordHook modified records with trackChanges enabled, preventing commit:completed events from firing.
Tell code reviewer how and what to test:
Automated Tests:
Manual Testing Needed:
settings.trackChanges = truebulkRecordHookthat modifies at least one fieldGET /v1/commits?sheetId=...commit:completedevent is emittedKey Review Points:
bulkRecordHooks are registered on the same sheet, each will callcompleteCommit(). The Platform backend guards against duplicate completions, but this may generate "Commit already completed" log messages.Related