Skip to content

fix: sync check-in status and counts live across devices - #153

Open
eloeerbe wants to merge 3 commits into
mainfrom
fix/live-checkin-sync
Open

eloeerbe wants to merge 3 commits into
mainfrom
fix/live-checkin-sync

Conversation

@eloeerbe

Copy link
Copy Markdown
Contributor

Closes #143

Swaps the one-time getDocs load on organizer tools for a live onSnapshot listener so check-ins and counts update on every organizer device without a refresh

Why: the local update code only covered for this on the device that did the check-in

Changes:

  • OrganizerTools.tsx: getDocs -> onSnapshot (unsubscribes when the page closes)
  • removed the local update in handleCheckIn and handleUpdateLocal / onUpdateLocal (listener handles it now)
  • selected participant is stored by id so the open card stays live

Note:

  • not tested on two devices yet, was not sure if there was a test database
  • lint and build pass locally

@eloeerbe
eloeerbe requested a review from TheJolman November 21, 2026 22:40
@TheJolman
TheJolman requested a review from GaballaGit November 22, 2026 18:08
@GaballaGit

Copy link
Copy Markdown
Member

This is a good PR, I haven't been able to test it locally yet, but I am going to write a few comments concerning the code.

Comment thread web/src/pages/Portal/OrganizerTools.tsx Resolved
@GaballaGit

Copy link
Copy Markdown
Member

This PR is just for organizers, but I want to also address a point for architectural and scaling, I think we should keep in mind how onSnapshot() keeps a connection to firebase open, constantly reading. This is fine for paths exclusive to organizers, but if we do something similar to a public facing path it can accumulate a lot of reads on firebase with many concurrent users.

However, refreshing the page a lot with getDoc() can actually accumulate more reads, depending on the users behavior, will they refresh a lot? Or will implementing onSnapshot() stop them from refreshing constantly? It is an interesting conversation for a meeting.

@GaballaGit

Copy link
Copy Markdown
Member

Since there are issues with accessing the organizers page right now Im just going to request a change and approve afterwards @eloeerbe

@eloeerbe

Copy link
Copy Markdown
Contributor Author

@GaballaGit applied the null fallback, thanks!

agreed on the reads. a listener charges a read every time a doc it's watching changes, and if it's disconnected 30+ min it re-reads everything like a new query. fine for organizers but for public pages we should prob stick with getDoc. down to talk about it at the meeting

@eloeerbe
eloeerbe requested a review from GaballaGit November 26, 2026 01:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

synchronize check-in status and counts in real time across organizer devices

2 participants