-
Notifications
You must be signed in to change notification settings - Fork 327
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
fix(measurements): The image stack sync tool fails to work on non-FOR instances and hangs the browser #642
Changes from all commits
8eaf9b7
494c034
2beff53
14831b2
d12103c
aaa2f1b
b903f04
5facd76
2c70fc7
8d560b9
21e682b
3f1a2f2
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 |
---|---|---|
|
@@ -205,6 +205,7 @@ class Synchronizer { | |
} | ||
|
||
this._ignoreFiredEvents = true; | ||
const promises = []; | ||
try { | ||
for (let i = 0; i < this._targetViewports.length; i++) { | ||
const targetViewport = this._targetViewports[i]; | ||
|
@@ -214,19 +215,26 @@ class Synchronizer { | |
if (targetIsSource) { | ||
continue; | ||
} | ||
|
||
this._eventHandler( | ||
this, | ||
sourceViewport, | ||
targetViewport, | ||
sourceEvent, | ||
this._options | ||
promises.push( | ||
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. I don't know how to avoid this synchronization - the basic synchronizer design relies on being able to turn off secondary notifications so that only a single change applies, and if this doesn't use async, then you get an event from the target viewport, which changs the source viewport, which sends an event etc. |
||
this._eventHandler( | ||
this, | ||
sourceViewport, | ||
targetViewport, | ||
sourceEvent, | ||
this._options | ||
) | ||
); | ||
} | ||
} catch (ex) { | ||
console.warn(`Synchronizer, for: ${this._eventName}`, ex); | ||
} finally { | ||
this._ignoreFiredEvents = false; | ||
if (promises.length) { | ||
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. @wayfarer3130 and I reviewed this on a call; this is causing issues in the TVM mode. This is also an important fix that was making the browser hang so we want to keep it. 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. Use the viewport status instead of making this async 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. Seems to be ok in the TVM mode now, at least I can't reproduce any hangs. I believe the issue was caused by multiple initial renders causing a loop, and the existing OHIF changes to prevent extra renders resolved the base issue. 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. @mateusfreira can you try again, It seems to work with tmtv now 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. @mateusfreira - you have to try it with the merge update branch of FlexView, as it was changes outside of CS3D that fixed the hang issue. 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. @mateusfreira can you try and let me know? 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. @sedghi and @wayfarer3130 I confirmed it is working as expected |
||
Promise.allSettled(promises).then(() => { | ||
this._ignoreFiredEvents = false; | ||
}); | ||
} else { | ||
this._ignoreFiredEvents = 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.
The changes in this file fix the browser hanging issue.