-
Notifications
You must be signed in to change notification settings - Fork 9
chore: add retries for write commits in core packages #1733
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
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 pull request adds retry mechanisms for write commits in core packages to improve reliability when updating cell data. The changes replace direct transaction commits with editWithRetry() calls, which automatically handle transaction conflicts and retry operations when necessary.
- Replaces manual transaction management with
editWithRetry()wrapper - Updates method signatures to return Promises where retry logic is added
- Adds comments explaining retry behavior in specific contexts
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/toolshed/routes/integrations/google-oauth/google-oauth.utils.ts | Replaces manual commits with retry logic for OAuth token persistence |
| packages/shell/src/lib/iframe-ctx.ts | Adds comment explaining why iframe writes don't use retries |
| packages/shell/src/lib/default-recipe.ts | Converts default recipe creation to use retry mechanism |
| packages/runner/src/runtime.ts | Updates setup method signatures to return Promises |
| packages/runner/src/runner.ts | Implements retry logic in setup and run methods |
| packages/runner/src/cell.ts | Adds comment about sink callback retry behavior |
| packages/runner/src/builder/json-utils.ts | Simplifies cell retrieval by removing unnecessary transaction |
| packages/charm/src/ops/charm-controller.ts | Adds retry logic for charm property updates |
| packages/charm/src/manager.ts | Converts charm management operations to use retries |
| packages/charm/src/iterate.ts | Adds retry for charm lineage updates |
| packages/background-charm-service/src/utils.ts | Converts background charm operations to use retries |
| packages/background-charm-service/src/space-manager.ts | Adds retry logic for charm status updates |
Comments suppressed due to low confidence (1)
packages/charm/src/manager.ts:1
- The function returns early with
return falseinside the retry callback, buteditWithRetryexpects the callback to either succeed or throw an error for retry logic to work properly. These early returns will be interpreted as successful operations.
import {
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
18 issues found across 12 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.
packages/toolshed/routes/integrations/google-oauth/google-oauth.utils.ts
Outdated
Show resolved
Hide resolved
… it's not modified, but cleaner)
cda57e8 to
25d77ef
Compare
Summary by cubic
Make all write operations resilient by using runtime.editWithRetry across core packages to prevent lost writes during conflicts. Also make Runner.setup/Runtime.setup async to support retryable transactions.
Refactors
Migration