Fix "failed to map parentId" errors and other correctness fixes#2008
Merged
Conversation
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes "failed to map parentId" errors and other correctness issues in the synchronization logic. The changes primarily address mapping-related bugs in the sync process and improve the handling of reorderings during synchronization.
- Corrects tree comparison logic in tests to use consistent tree references
- Fixes mapping cleanup timing to prevent orphaned mappings that cause "failed to map parentId" errors
- Improves reordering reconciliation logic with better mapping handling and parameter naming
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/test.js | Updates test assertions to use correct tree references and replaces hardcoded values with constants |
| src/lib/strategies/Unidirectional.ts | Adds proper mapping cleanup for removed items in unidirectional sync |
| src/lib/strategies/Merge.ts | Fixes method signature and parameter naming for reordering reconciliation |
| src/lib/strategies/Default.ts | Major refactoring of mapping cleanup timing and reordering reconciliation logic |
| src/lib/browser/BrowserTree.ts | Adds safety check to skip missing items during folder reordering |
| src/lib/Mappings.ts | Adds new utility method and improves string comparison in mapping checks |
| src/lib/Diff.ts | Optimizes parent containment checking with caching and improves chain finding logic |
make sure to convert to string before comparing Signed-off-by: Marcel Klehr <mklehr@gmx.net>
e1700c3 to
db02934
Compare
improves processing times for large diffs by up to 29% Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
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.
Signed-off-by: Marcel Klehr mklehr@gmx.net