Closed rzadp closed 4 years ago
Can you clean out both ends storage and report?
The first assertion error is from the lack of a Party 'properties' item, which would at least suggest that the party data was old.
The second could easily be caused by the first call failing, since we never unsubscribed to the Party and left the swarm, we cannot rejoin it.
From slack:
@rzadp I just published @dxos/party-manager@1.0.1-beta.20 it has a fix for a race condition so far so good for me, can you try again as well?
@telackey I have tried out the newest version which is 1.0.1-beta.21
Yeah most of the issues seem to be gone, except one. I have recorded it, it's at 1:50.
https://drive.google.com/file/d/1rVzOSAEusMMqqk24RPMmcaIlDGrpflmU/view?usp=sharing
@telackey Also I have merged the branch into master, so please be looking at current master of teamwork for this
From slack:
So it looked like the test [that failed] was: reloading toggling unsubscribe/resubscribe as quickly as possible reloading again toggling again as quickly as possible keep repeating the above to see if anything breaks Is that correct?
yes, that was basically the test 10:40 But not really toggling "as quicky as possible", I believe I click resub only after the party displays as gray, and only click unsub if the party is not gray 10:41 (party being gray means we read it's state as unsubscribed)
I think the question to this is how carefully we want to prevent an error like this, and at what level.
As things stand, we begin loading and opening parties from a multi-feed based stream, and it is quite possible to initialize a party before reading that its subscription state is now false, at which point, if it happens to have been opened, we will close it. But closing is triggered by an event independent of the UI, and it also takes a variable amount of time.
What I think is happening in this last scenario is a case where:
There are a few ways we might fix this, all of which basically involve deciding when is the right time to trigger an event (eg, in this case, should the update event on the PartyInfo object have been triggered only after obtaining some status from network-manager that it had finished closing?)
I am also not sure of the priority of controlling for all such cases right now. @dboreham ?
Question: can this issue be entirely worked around by "just not clicking quickly"?
I was about to say, "I think so", but I finally managed to reproduce it, and though I'm not sure why, it doesn't seem just about timing.
In my case I had three parties. I unsubscribed all three. Of those three, if I refresh, I can click two of them 'subscribe' ASAP with no issue. The third fails with this error even after waiting a few seconds. It doesn't matter which order I click them in. The parties that work always work, the party that gives this "already joined" error always gives it.
Always may be too strong a term, because if I refresh and try it several times, it mostly works. But if it happens to give the error, it is consistently that party.
This should be fixed in v1.0.1-beta.24.
@rzadp ^
The errors described here were recorded on
dxos/teamwork
branch inrzadp-unsubscrive
here, using@dxos/party-manager@1.0.1-beta.18
.Features used:
https://github.com/dxos/teamwork/blob/961f99efb1ad6f274cd0733ca072a41a693f0b1b/apps/teamwork-app/src/components/PartyGroup.js#L99-L107
Video reproduction
3 different kinds of errors are happening, as seen in the vid:
https://drive.google.com/file/d/1yFIGw2yaxe9r2rpg9jjeTWR0VgrwMyjS/view?usp=sharing
First error
Happens randomly when trying to unsubscribe from a party. At 0:10 in the vid.
Second error
Happens when rejoining a party. 2:10 in the vid.
Third error
This one seems to be happening more randomly, took quite a while to reproduce this in the recorded video.. Fast forward to 5:25 to see it.
It sometimes happens when refreshing the page and loading everything from scratch, provided that there are some unsubscribed parties.