-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Fix: cannot load segmentation after export in local mode #5999
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
d0c7aee
e3da11c
cf98514
1756006
665b21d
e32cb82
f69f68c
b8762c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,13 @@ class MetadataProvider { | |
| return; | ||
| } | ||
|
|
||
| return (frameNumber && combineFrameInstance(frameNumber, instance)) || instance; | ||
| const combined = frameNumber && combineFrameInstance(frameNumber, instance); | ||
| if (combined) { | ||
| // Add imageId to multiframe result so it matches single-frame instance. | ||
| combined.imageId = imageId; | ||
| return combined; | ||
| } | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
| return instance; | ||
|
Comment on lines
+63
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid mutating shared store instances when This block assumes 💡 Suggested fix (isolate before assignment when needed)- const combined = frameNumber && combineFrameInstance(frameNumber, instance);
- if (combined) {
- // Add imageId to multiframe result so it matches single-frame instance.
- combined.imageId = imageId;
- return combined;
- }
- return instance;
+ const combined = frameNumber && combineFrameInstance(frameNumber, instance);
+ if (!combined) {
+ return instance;
+ }
+
+ // Some paths can return the original cached instance.
+ const result = combined === instance ? Object.create(instance) : combined;
+ result.imageId = imageId;
+ return result;🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| get(query, imageId, options = { fallback: false }) { | ||
|
|
||
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.
Guard
SharedFunctionalGroupbefore destructuring to avoid a remaining crash path.On Line 293,
const { PixelMeasuresSequence } = SharedFunctionalGroup;can still throw whenSharedFunctionalGroupsSequenceis missing/empty, so the new fallback on Lines 295–300 is never reached in that case. Please guardSharedFunctionalGroupfirst (and ideally fall back to per-frame pixel measures).Proposed fix
function _getReferencedDisplaySetMetadata(referencedDisplaySet, segDisplaySet) { - const { SharedFunctionalGroupsSequence } = segDisplaySet.instance; + const { SharedFunctionalGroupsSequence, PerFrameFunctionalGroupsSequence } = segDisplaySet.instance; const SharedFunctionalGroup = Array.isArray(SharedFunctionalGroupsSequence) ? SharedFunctionalGroupsSequence[0] : SharedFunctionalGroupsSequence; - const { PixelMeasuresSequence } = SharedFunctionalGroup; + const PerFrameFunctionalGroup = Array.isArray(PerFrameFunctionalGroupsSequence) + ? PerFrameFunctionalGroupsSequence[0] + : PerFrameFunctionalGroupsSequence; + + const PixelMeasuresSequence = + SharedFunctionalGroup?.PixelMeasuresSequence ?? PerFrameFunctionalGroup?.PixelMeasuresSequence; const PixelMeasures = (Array.isArray(PixelMeasuresSequence) ? PixelMeasuresSequence[0] : PixelMeasuresSequence) || {}; if (!PixelMeasuresSequence || Object.keys(PixelMeasures).length === 0) { console.warn('PixelMeasuresSequence missing from SEG instance metadata.'); }🤖 Prompt for AI Agents