Skip to content

feat: Target affect chunks only for invalidation after edit operations#153

Merged
seankmartin merged 5 commits into
feature/edit-modefrom
feature/NA-716
May 11, 2026
Merged

feat: Target affect chunks only for invalidation after edit operations#153
seankmartin merged 5 commits into
feature/edit-modefrom
feature/NA-716

Conversation

@afonsobspinto
Copy link
Copy Markdown
Member

Closes https://metacell.atlassian.net/browse/NA-716

  1. do action A (f.e. delete node)
  2. action A invalidates the cache
  3. We pull all the visible chunks again from the backend
  4. while the pulling is still hapening, we click undo
  5. The undo request is queued but only processed when the other fetching finishes. (which can take a few, noticeable seconds)

To solve it we narrows the stale browse surface to affected cells and makes remaining browse traffic lower browser/network priority, so edit requests do not compete as heavily with large node/list bursts.

  • The main change is replacing broad CATMAID spatial skeleton browse-cache invalidation with targeted cell invalidation.

    • Delete invalidates only deleted node, parent, and direct children.
    • Split invalidates the split subtree plus the former parent.
    • Merge invalidates the deleted/losing segment nodes plus merge endpoints.
  • CATMAID node/list browse fetches are marked low priority with fetch(..., { priority: "low" })

  • Fixes regression on merge with non-inspected skeleton that was pulling the full skeleton before the merge

@afonsobspinto afonsobspinto changed the base branch from refactor/skeleton-frontend to feature/edit-mode May 8, 2026 20:32
Copy link
Copy Markdown

@seankmartin seankmartin left a comment

Choose a reason for hiding this comment

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

Looks good to me, a note on a comment that's not quite accurate but can change that after

Comment thread src/skeleton/frontend.ts
const { chunkDataSize } = chunkSource.spec;
for (const position of positionList) {
// Spatial skeleton node positions are already source/model coordinates;
// render-layer transforms do not apply to CATMAID grid-cell keys.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should change this comment, not CATMAID specific - applies to any skeleton key

feat: Keep selection when activating edit tools
@seankmartin seankmartin merged commit 88c120c into feature/edit-mode May 11, 2026
1 check passed
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