Conversation
…1001) * Fix page-boundary corruption when line_parts count changes on PATCH deep-object-diff classifies a line index as "added" whenever any nested property is new (e.g. an extra line_part). The backend "added" branch created a new ScriptLineRevisionAssociation without removing the old one, leaving two associations both satisfying the first-line-of-page condition and breaking the GET endpoint with "Failed to establish page line order". Frontend: filter deepDiff.added by null id — existing lines with nested additions are reclassified as updated before being sent to the server. Backend: precompute is_truly_new / is_updated so existing-id lines in status["added"] route through the update path, not the create path. Migration: 897ae2963f6d repairs any already-corrupted linked lists on all revisions, using max(line_id) to select the correct bridge line when duplicates exist, and cleans up orphaned script_lines / script_line_parts. Tests: two regression tests in TestPatchLinePartCountChange verify that both a single-page and cross-page-boundary PATCH return 200 after a line_parts count increase with status=added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add frontend unit tests for deepDiff page-status classification Extract the deepDiff + status-building logic from SAVE_CHANGED_PAGE into a pure exported helper (computePageStatus) so it can be tested without a Vuex store. Add 7 Vitest tests covering: existing line whose line_parts grew (must go to updated, not added), truly new line (added), top-level field change (updated), deleted/inserted pass-through, mixed page, and no-change baseline. Tests 1 and 6 fail when the id != null filter is removed, confirming they catch the original deep-object-diff misclassification regression. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Extract shared SQL helpers to eliminate migration duplication Create alembic_config/repair_linked_list_utils.py with the common building blocks (fetch_page_associations, build_page_ordered, build_global_order, compute_expected_pointers, fetch_current_pointers, collect_pointer_updates, delete_orphan_associations, apply_pointer_updates, fetch_all_revision_ids) shared by both repair migrations. Refactor c2f8d4a6e0b3 and 897ae2963f6d to import from this module. The two migrations now differ only in bridge-line selection strategy (first-found vs max) and in whether they clean up orphaned script_lines/ script_line_parts rows. Also apply ruff formatting to test_script.py (missed in prior commit). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Client Test Results106 tests 106 ✅ 0s ⏱️ Results for commit 08be26e. ♻️ This comment has been updated with latest results. |
|
Python Test Results 1 files 1 suites 1m 18s ⏱️ Results for commit 08be26e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



No description provided.