-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor firebase root id computation #2403
Conversation
- needed to relax the security rules for the dev root - update user icon roll over so devs know the root - update firebase and firestore to share the same logic for computing the root id based on the appMode
collaborative-learning Run #13764
Run Properties:
|
Project |
collaborative-learning
|
Branch Review |
188211348-local-storage-dev-root
|
Run status |
Passed #13764
|
Run duration | 13m 30s |
Commit |
62d0166478: remove the local storage dev root id
|
Committer | Scott Cytacki |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
4
|
Skipped |
0
|
Passing |
110
|
View all changes introduced in this branch ↗︎ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2403 +/- ##
==========================================
- Coverage 85.91% 85.90% -0.01%
==========================================
Files 736 737 +1
Lines 37816 37824 +8
Branches 9623 9624 +1
==========================================
+ Hits 32490 32494 +4
- Misses 5021 5025 +4
Partials 305 305
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@kswenson I added you as the reviewer of this one. You've used dev mode more than anyone else, so it seems right that you should weigh in on the options above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good -- of the options you presented, this one seems the best to me:
or apply a stripped down version of it that has the refactoring without the functional change. In this case appMode dev will function the same as appMode qa. A new firebase user will be created by each tab that is opened and will get its new root. A developer can't build up a collection of documents and users in Firebase. At least appMode dev won't be broken in weird ways.
I think the need to build up dev
documents over time is somewhat rare, and if needed one can always use demo
for that. It'd be nice to fix the firebase functions to handle this case at some point, but having dev
work like qa
in the short term seems better than having it be broken in weird ways.
This dev root approach requires the firebase functions to be updated and there isn't time to do that, now. The refactoring is kept so applying the change will be easier in the future.
This puts a random id in local storage and uses it for the Firestore and Realtime database root ids. This approach is currently broken though, because the Firebase functions have not been updated to use this same root id. The functions continue to use the Firebase user id instead. See this PR for more info: #2403
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM
Co-authored-by: Kirk Swenson <[email protected]>
This PR started as a change to use a random id in local storage for the root id when the appMode is dev. However that approach couldn't be finished because the Firebase functions needed to be updated. That incomplete work was split out into its own PR: #2407
What remains in this PR is:
Historical Options
When this PR included the local random id, the following options were considered for dealing with the problem of the broken functions. See #2407 for more info.
There is not enough time to fix the functions, so we have to look at other options.