Closed mvaled closed 8 years ago
Can not reproduce. Try to increase timeout. Also note we have a couple of tests for locks https://github.com/nodeca/tabex/blob/1.0.3/test/client_iframe.js#L110-L146.
If you still think that bug exists - create a more detailed instruction how to reproduce, step-by-step. And check that tests are ok.
I'll try to give further details... But I'm not familiar with the latest tools for testing js code...
I created a clip showing how I test it (I know it won't help much, but at least you can see what I'm doing). The clip is in https://youtu.be/50SzIix6tf4
@mvaled, second parameter of .lock()
is lifetime in milliseconds. On video we can see delay between two clicks about 3 seconds. Just set correct lifetime of lock.
Then I got wrong the meaning of the lock primitive. I thought I would held the lock until I call the unlock function or the tab closes...
I thought the timeout was the timeout before giving up to get the lock not the time the lock was to be held.
My use case is similar to the one exposed in the README: keep a single long-polling connection to the server between tabs. But I didn't wan't to use the '!sys.master' signal because I thought that higher level primitives could be used for the task.
I'm opening the following page in two tabs and both report the "Lock acquired":
Environment:
Firefox 44, no private mode, I can confirm that localStorage events are being propagated between tabs.