Currently queryAuthStatus (a function that is called by every client on every page load, and that blocks usage until it returns) reads in all customers and loops through them to find matches for phone/email.
It could instead use two indices and two where queries.
in auth.ts causes an error if the function is called by an unauthenticated user. I was testing the function with curl, so it's very much possible a similar thing never happens using the app. Still, it makes sense to not throw an exception in that case.
Currently
queryAuthStatus
(a function that is called by every client on every page load, and that blocks usage until it returns) reads in all customers and loops through them to find matches for phone/email.It could instead use two indices and two
where
queries.I believe the indices are automatically created by firebase already.
There were two small fixes still to do in #932 that makes sense to do in this context.
It also makes sense to fix this sentry entry in this context. The gist of it is that the line
in
auth.ts
causes an error if the function is called by an unauthenticated user. I was testing the function withcurl
, so it's very much possible a similar thing never happens using the app. Still, it makes sense to not throw an exception in that case.