fix: listen to user doc changes instead of fetching doc to check if exists #226
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: Pull Request
about: Open a PR for p0tion
Description
See https://discord.com/channels/943612659163602974/1166371125450768495/1167435859755278357
It looks like in case of a lag between the
auth
command and thecontribute
command, the user document may not yet exist in firebase.As a solution we can listen for document changes and wait for the document to
exists()
.Fixes #220
How Has This Been Tested?
waitForUserDocumentToExist
My unit test is a bit artificial so I am 100% my fix works as expected, I'd like to run additional manual e2e testing, but I am not sure how...
Checklist:
This PR deliberately doesn't follow style guidelines to avoid big diff, I suggest merging chore: format, lint #225 first then rebase