Playabl-io / playabl

https://app.playabl.io
GNU Affero General Public License v3.0
7 stars 3 forks source link

User in the pivot seat can get notified repeatedly when others leave a session #156

Closed jongrim closed 1 year ago

jongrim commented 1 year ago

Describe the bug In the leave_session database function, after someone removes their rsvp, we send a message to whoever is sitting in the last RSVP spot. This was done to handle notifying someone if they were just bumped into the spot, but since we don't check who was there prior, it is possible to send a message to someone who was already in the game.

The database function needs to be updated to consider who was in the spot prior, and only notify if the person changed.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

jongrim commented 1 year ago

I applied an update to the database function to pull the current rsvp before removing the person leaving, and compare afterwards to determine if a notification should be sent.