Closed rzadp closed 3 years ago
The party is already open after calling party.activate. Calling party.open again shouldn't hang, but it isn't proper either.
The problem in this case is that party.getPropertiesItem() looks like this:
getPropertiestItem (): Item<ObjectModel> {
const { value: items } = this.database.queryItems({ type: PARTY_ITEM_TYPE });
assert(items.length === 1);
return items[0];
}
But just because the Party is open does not mean that item has been processed, and in fact that item will never be processed until after the Party is open.
So the fix is to wait on that item, either here, or by changing this into a result set we can wait on, or if we really want to, by waiting for it at the end of party.open, so we don't return until after this has been processed.
@rzadp ^^
by waiting for it at the end of party.open, so we don't return until after this has been processed
I think this might be the best solution, especially given that we have already run into this problem before - https://github.com/dxos/echo/issues/311
There are issues with reactivating party.
The party is not (completely) open after activating.
This code:
Effects in:
The attempt at awaiting party open:
Results in the call to
party.open()
hanging forever.