-
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
live update sorted documents #2408
Conversation
- remove unnecessary DocumentContext around SimpleDocumentItem - switch usage of IDocumentMetadata to IDocumentMetadataModel (the MST model) - add disposer for the metadata docs watcher - make SimpleDocumentItem an observing component so it updates when the visibility changes. - update tests to work with the new metadataDocsFiltered property - update sorted-documents to have two MST models for the filtered and withoutUnit metadata docs. These models are kept in sync with the Firestore query results. - update the queries to use Firebase `onSnapshot` listeners instead of just calling `get` - have the `onSnapshot` listeners merge the exemplar docs and then apply the new query results to the MST models - turn firestoreMetadataDocs into a view that combines all of the documents together.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2408 +/- ##
=======================================
Coverage 86.16% 86.17%
=======================================
Files 736 736
Lines 37814 37842 +28
Branches 9626 9624 -2
=======================================
+ Hits 32584 32609 +25
- Misses 4931 4935 +4
+ Partials 299 298 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
collaborative-learning Run #13807
Run Properties:
|
Project |
collaborative-learning
|
Branch Review |
188123062-live-update-sorted-docs
|
Run status |
Passed #13807
|
Run duration | 13m 45s |
Commit |
0d1ece27fa: remove console log, fix comment
|
Committer | Scott Cytacki |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
3
|
Skipped |
0
|
Passing |
111
|
View all changes introduced in this branch ↗︎ |
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 to me 👍 I left a couple non-blocking comments/questions. There's also a console statement in src/models/stores/sorted-documents.ts that looks like it isn't needed.
problem: metadataDoc?.problem || undefined, | ||
investigation: metadataDoc?.investigation || undefined, |
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.
This confused me a little and I want to be sure I understand. Did you add || undefined
here because metadataDoc.problem
and metadataDoc.investigation
are typed as maybeNull
and we should use undefined
here instead if they are null
?
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.
Another good catch. I've updated this with a comment and unified the way they are handled.
onSnapshot
listeners instead of just callingget
onSnapshot
listeners merge the exemplar docs and then apply the new query results to the MST models