Skip to content

Conversation

@seefeldb
Copy link
Contributor

Instead of modifying the doc, just do the bare minimum re-applying of the push & return that value

Copy link
Contributor

Copilot AI left a 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 addresses the issue with the push retry mechanism when handling object values by reapplying the push operation and returning the updated value.

  • Updated test cases to validate retry behavior, including handling IDs in pushed objects.
  • Revised the retry logic in the cell implementation to reapply pushes using serialized appended values.
  • Adjusted import paths for consistency and isolation of dependencies.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
runner/test/push-conflict.test.ts Updated tests to validate retry behavior with objects and ID handling.
runner/src/cell.ts Revised retry logic implementation to correctly serialize and reapply pushes.
Comments suppressed due to low confidence (1)

runner/src/cell.ts:423

  • [nitpick] Consider checking for both undefined and null for newBaseValue to ensure that cases where null might occur are handled appropriately.
if (newBaseValue === undefined) {


// Serialize cell links that were appended during the push. This works
// because of the .toJSON() method on Cell.
const newValues = JSON.parse(JSON.stringify(appended));
Copy link

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Serializing the appended values using JSON.parse(JSON.stringify(...)) may strip non-enumerable properties; consider using a more robust serialization approach if these properties are needed in the retry logic.

Copilot uses AI. Check for mistakes.
@seefeldb seefeldb merged commit 280fcfa into main Mar 27, 2025
6 checks passed
@seefeldb seefeldb deleted the fix-retry-push-with-objects branch March 27, 2025 22:43
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.

2 participants