chore(InteractorStyleMPRSlice): fix recursion error in example#3554
Open
Jo-Byr wants to merge 1 commit into
Open
chore(InteractorStyleMPRSlice): fix recursion error in example#3554Jo-Byr wants to merge 1 commit into
Jo-Byr wants to merge 1 commit into
Conversation
finetjul
requested changes
Jul 16, 2026
finetjul
left a comment
Member
There was a problem hiding this comment.
It should be fixed in InteractorStyleMPRSlice instead of the example.
Limit slice widget update in example to prevent recursion error between the controller and interactor style
Jo-Byr
force-pushed
the
fix-interactor-style-mpr-slice-example
branch
from
July 16, 2026 13:32
dd8aeba to
2ed5a8a
Compare
daker
suggested changes
Jul 16, 2026
| }; | ||
|
|
||
| publicAPI.setSlice = (slice) => { | ||
| if (publicAPI.getSlice() == slice) { |
finetjul
reviewed
Jul 16, 2026
Member
There was a problem hiding this comment.
I'm glad this fixes the example.
However, I think it does not fix the root of the problem.
The InteractorStyleMPRSlice is temporarilly notifying observers of an invalid "slice".
The problem is that it triggers a modify event between line 174 and line 175. When the state is unstable.
A proper fix should be to prevent such notification while the camera is being updated.
|
|
||
| publicAPI.setSlice = (slice) => { | ||
| if (publicAPI.getSlice() == slice) { | ||
| return; |
Member
There was a problem hiding this comment.
it would be great, to be consistent with other setters, that it returns "false" when slices are similar. And "true" if they are different.
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.
Context
InteractorStyleMPRSlice example fails due to a recursion error.
Results
The error is fixed so the example works.
Changes
Added a difference threshold on the interactor Stume slice update to avoid recursion error
PR and Code Checklist
npm run reformatto have correctly formatted code