Open jinyoung-lim opened 6 years ago
Tried making the deleteRoom
as a transaction. Although some documentation say that firebase transactions support delete()
, did not work.
Also tried making deleteRoom
asynchronous by having async deleteRoom
. Not sure if that solves this issue. However, guests got multiple kicking out alerts so do not think we should use async method.
What if you delay deleteRoom
so that it doesn't run until the transaction finishes? See deleteSong
in host-song-list.ts
for syntax.
Edit: Nevermind this probably wouldn't help.
A guest did not get kickout out. Instead, songs were deleted except for one song that the guest was adding. That is why we suspect that it is due to the way that firebase handles a transaction that is causing the problem... Our theory is that when
deleteRoom
is called, it is handled simultaneously (or before) with the transaction. If thedeleteRoom
finishes before the transaction, the roomRef and songRef the transaction is using would recreate the room (and the song)...