Skip to content
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

"Viewer 1" updates/requests fail once "Viewer 2" is created #708

Open
bnmajor opened this issue Dec 13, 2023 · 2 comments
Open

"Viewer 1" updates/requests fail once "Viewer 2" is created #708

bnmajor opened this issue Dec 13, 2023 · 2 comments

Comments

@bnmajor
Copy link
Collaborator

bnmajor commented Dec 13, 2023

When there are multiple viewers within one notebook only calls to the most recently created viewer succeed. For example:

viewer_1 = view(image)
viewer.set_rotate(True)  # succeeds
viewer_2 = view(image)
viewer.set_rotate(False)  # fails
viewer_2.set_rotate(True)  # succeeds

Originally this seemed to be related to the major updates now available in v1.0a41 - For example, the cells

annotations = viewer.get_annotations_enabled
annotations

return

TypeError: Cannot read properties of undefined (reading 'getAnnotationsEnabled')

Testing with previous releases shows that this is actually a long-standing issue. It seems that the reference to the window object returned from api.createWindow no longer has the ImJoyPluginAPI available after another window is created.

@oeway Have you seen behavior like this before?

@thewtex
Copy link
Member

thewtex commented Dec 13, 2023

I like the improvement @oeway made with hypha -- it is more functional, passing a reference to all objects used in the API, like the viewer in this case. Maybe need a version of that with the imjoy rpc?

@oeway
Copy link
Collaborator

oeway commented Dec 14, 2023

Hi, guys, yeah, I will need to investigate it a bit to see how to fix! Or maybe a more sustainable plan is to migrate to hypha RPC in ImJoy.

Unfortunately, I am a bit overloaded at the moment, will have to look into this in 2024!

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

No branches or pull requests

3 participants