-
Notifications
You must be signed in to change notification settings - Fork 197
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
Client not fully being "destroyed" with destroy event dispatched (unload-client.js) #3131
Comments
TL;DL; loading in an older version of the client appears to resolve my navigation issue. I noticed my browser extension is version So out of curiosity, I added:
Which loaded an older version of the boot and bundle files (v1.600 just an arbitrary pick), and this more-or-less fixed the aforementioned "destroy" client bug. However, clicking selections no longer opens the sidebar - I'm guessing this isn't a "preferred" way to load a specific version. For instance the following are still being created from the
And Is there a preferred way to load an older version of the client? |
Is it fair to say that when the browser extension updates to 1.700 a similar problem will occur if the user toggles the extension on and off? |
UPDATE Steps to reproduce has been update due to some fixes that came with recent nightly builds of the Hypothesis client. See Step #10 above. |
UPDATE added new set of steps to reproduce once I got the local version of |
Does #3174 close this issue? |
@esanzgar based on the testing I did locally, yes I believe so. Thanks! |
I am using the Hypothesis Client embedded within a single page application (VueJS) with client side routing (Browser History API). I've been informed in previous discussions that Hypothesis doesn't directly support SPA implementation because of the dynamic nature of client side routing. The annotation selection targeting gets all screwy :)
However, @robertknight has recommended I use the browser-extension
unload-client
approach to reload the embedded client on demand. So in my VueJS application, when a route changes I run the code found in the unload-client script. TheaddEventListener
for thedestroy
event can be found here.This was working beautifully! However, as of late this appears to be broken - when I navigate pages the selection highlights become "stacked" on top of each other, the annotation counts double, and the Hypothesis menu when making a selection no longer works.
UPDATE: This bug however will most likely appear once the browser extension updates to the newest build. See the first set of steps to reproduce.
Steps to reproduce
If you have a local copy of the
client
andh
running:Another way to recreate this "unload client" bug. You don't need to spin up an SPA or have Hypothesis locally to recreate this issue, the following steps should suffice:
This code will dispatch a "destroy" event to the annotator client.
All appears fine at first, but if you dev inspect one of the existing selections or look at one of the floating annotations counter affixed to the sidebar, the annotations are doubling each time you run this process. If you try and make another selection and click "Annotate" on the fly out menu, it doesn't work.Expected behaviour
For the embedded client to full reboot and not leave any remnants behind.
Actual behaviour
See "Steps to reproduce"
Browser/system information
Latest version of Chrome
The text was updated successfully, but these errors were encountered: