-
Notifications
You must be signed in to change notification settings - Fork 29
Fix regression with DiffableMaps and duplicate agglomerate skeletons #8656
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
📝 WalkthroughWalkthroughThis update fixes a crash during tree import when annotations are non-empty, modifies a test fixture to export a variable, adds tests for tree ID relabeling, and refactors a helper function to use immutable patterns for tree collections. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
// The original tree id 4 should have survived. | ||
expect(ids).toEqual([4]); | ||
expect(state.annotation.skeleton?.trees.size()).toBe(1); | ||
expect(state.annotation.skeleton?.trees.getNullable(4)).toBeDefined(); |
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.
Does it make sense to also test that the newly added tree has tree id 5(?) now?
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.
yes, doesn't hurt. luckily, the id will be 4 and not 5 😅
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.
LGTM
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.
Actionable comments posted: 0
♻️ Duplicate comments (1)
frontend/javascripts/test/reducers/skeletontracing_reducer.spec.ts (1)
1813-1817
: Test implementation is correct.The test properly verifies that tree IDs are preserved when adding to an empty skeleton. The assertion confirms the tree retains its original ID of 4.
Note: The past review comment about testing tree id 5 doesn't apply here as this test intentionally uses ID 4 to verify no relabeling occurs.
🧹 Nitpick comments (1)
frontend/javascripts/test/reducers/skeletontracing_reducer.spec.ts (1)
1801-1803
: Consider clarifying the comment about ID relabeling.The current comment could be misinterpreted. Consider rephrasing for clarity.
- // Id-relabeling is only done if the skeleton is not empty. - // Therefore, delete the two existing trees so that the new tree will - // be added without id-relabeling. + // When the skeleton is empty, ID relabeling is not performed. + // Therefore, delete the two existing trees so that the new tree will + // retain its original ID.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
frontend/javascripts/test/fixtures/hybridtracing_object.ts
(2 hunks)frontend/javascripts/test/reducers/skeletontracing_reducer.spec.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: backend-tests
- GitHub Check: frontend-tests
- GitHub Check: build-smoketest-push
🔇 Additional comments (3)
frontend/javascripts/test/fixtures/hybridtracing_object.ts (1)
33-33
: LGTM!The export addition follows the existing pattern in the file and is necessary for the new test cases.
frontend/javascripts/test/reducers/skeletontracing_reducer.spec.ts (2)
12-13
: Import changes look good.The imports are properly organized and necessary for the new test cases.
Also applies to: 18-24
1820-1839
: Test correctly validates ID relabeling behavior.The test properly verifies that large tree IDs are relabeled to the next available ID when adding to a non-empty skeleton. Good coverage of both positive (new ID exists) and negative (old ID doesn't exist) assertions.
…8656) * create new tree map when re-assigning tree ids instead of adding to old map * add tests for addTreesAndGroupsAction * update changelog * fix typo * also assert ids
This PR fixes an issue with with WK loading duplicate tree when enabling agglomerate skeletons. This bug is a regression from #8596 .
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)