View Trips Page Real time Updates#96
Merged
Merged
Conversation
anan-ya-y
approved these changes
Jul 22, 2020
keiffer01
requested changes
Jul 23, 2020
keiffer01
reviewed
Jul 23, 2020
Collaborator
keiffer01
left a comment
There was a problem hiding this comment.
Wow, the real-time feature is really nice for such a relatively small change to the code, pretty nice! FYI Chrome incognito windows might help when testing with two different accounts simultaneously.
Collaborator
Author
Yeah it is super nice! I tried to use incognito windows but it did not work when trying to log in. I got this error: |
keiffer01
approved these changes
Jul 24, 2020
…tripArr for more clarity.
HiramSilvey
approved these changes
Jul 29, 2020
Issue earlier with error component must have been a different error that was accidentally fixed when switching to the asynchronous version of this function.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is a quick description of the change?
Enable real time updates such that any collaborator's update to a trip (add, edit, or delete) is immediately reflected in the local view of the trip for all collaborators.
Is this fixing an issue?
fixes #62
Are there more details that are relevant?
The main addition of this PR is to the
ViewTripsdirectory with the following files:trips-container.js:getwas replaced withonSnapshotwhen querying trips in order to use the real-time update features Firestore has to offer.queryuserTripsandserveTripswere combined and moved intocomponentDidMount.This was done due to the constraints set byonSnapshot: both the querySnapshot handling callback and the error callback must be passed intoonSnapshotrather thanonSnapshotreturning a promise.index.js,save-trip-modal.js,trip.js, anddelete-trip-button.js: Remove all functions, variables, props, and references relatedrefreshTripContainer(including TODOs to fix Implement Real Time Updates for all Trip Collaborators #62).Check lists (check
xin[ ]of list items)As of now, integration (end-to-end) tests were deemed non-critical. Thus, functions related to react and firestore will be tested at a later time. Unit tests were not written for this PR as there was no (original) "logical" functions written to complete this feature.
Any additional comments?
GIF showing real-time updates for a shared trip between users step2020.53.test1@gmail.com and step2020.53.test2@gmail.com:

Note: I could not use two chrome windows because only one user can be signed into SLURP at a time in all instances of chrome. So the left window is Firefox ESR (that is why it looks kinda gross).