-
Notifications
You must be signed in to change notification settings - Fork 9
feat(runner): implement await storage.synced() for new TX system #1503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(runner): implement await storage.synced() for new TX system #1503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the synced() method across the storage system to properly wait for all pending synchronization and commit operations to complete in the new transaction system.
- Add
synced()method to storage interfaces and implementations - Track commit promises in Replica to enable awaiting pending transactions
- Implement comprehensive sync waiting that covers both document syncs and transaction commits
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/runner/src/storage/interface.ts | Add synced() method signatures to IStorageManager and IStorageProvider interfaces |
| packages/runner/src/storage/cache.ts | Implement synced() functionality, track commit promises, and add getAllPromises() helper |
| packages/runner/src/storage.ts | Update Storage.synced() to use new implementation when not in shim mode |
packages/runner/src/storage/cache.ts
Outdated
Copilot
AI
Jul 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type assertion as unknown as Promise<void> is unsafe and obscures the actual return type. Consider using void in the Promise.all() call or explicitly handling the array result.
| ]) as unknown as Promise<void>; | |
| ]).then(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic analysis
No issues found across 3 files. Review in cubic
Add synced() method to wait for all pending syncs and commits to complete: - Add synced() to IStorageManager and IStorageProvider interfaces - Track commit promises in Replica to await pending transactions - Implement synced() in Provider to wait for both subscriptions and commits - Add getAllPromises() to SelectorTracker for subscription tracking - Update Storage.synced() to use new implementation when not in shim mode This ensures all pending operations complete before synced() resolves, including both document syncs and transaction commits.
2fc5ea6 to
68cb124
Compare
Add synced() method to wait for all pending syncs and commits to complete:
This ensures all pending operations complete before synced() resolves, including both document syncs and transaction commits.
Summary by cubic
Added a synced() method to the storage system to ensure all pending syncs and transaction commits finish before continuing.