ahelfins / Democratic-DJ

This repository has been moved to another GitHub repo. The repo is linked in the website, and is called MusicMaven.
https://github.com/zskluzac/musicmaven
0 stars 2 forks source link

Guests do not get kicked out if their voting transaction is still going through... #32

Open jinyoung-lim opened 6 years ago

jinyoung-lim commented 6 years ago

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 the deleteRoom finishes before the transaction, the roomRef and songRef the transaction is using would recreate the room (and the song)...

jinyoung-lim commented 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.

masaom commented 6 years ago

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.