Skip to content
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

Merged
merged 5 commits into from
Sep 20, 2024
Merged

Conversation

scytacki
Copy link
Member

  • 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.

- 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.
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 98.82353% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.17%. Comparing base (812c3c4) to head (0d1ece2).
Report is 47 commits behind head on master.

Files with missing lines Patch % Lines
src/models/stores/sorted-documents.ts 98.57% 1 Missing ⚠️
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     
Flag Coverage Δ
cypress-regression 77.79% <98.76%> (+0.01%) ⬆️
cypress-smoke 28.06% <13.58%> (-0.01%) ⬇️
jest 48.76% <43.20%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cypress bot commented Sep 17, 2024

collaborative-learning    Run #13807

Run Properties:  status check passed Passed #13807  •  git commit 0d1ece27fa: remove console log, fix comment
Project collaborative-learning
Branch Review 188123062-live-update-sorted-docs
Run status status check passed Passed #13807
Run duration 13m 45s
Commit git commit 0d1ece27fa: remove console log, fix comment
Committer Scott Cytacki
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 3
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 111
View all changes introduced in this branch ↗︎

@scytacki scytacki marked this pull request as ready for review September 19, 2024 14:10
@emcelroy emcelroy self-requested a review September 19, 2024 14:21
Copy link
Contributor

@emcelroy emcelroy left a 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.

src/models/stores/document-group.test.ts Outdated Show resolved Hide resolved
Comment on lines 357 to 358
problem: metadataDoc?.problem || undefined,
investigation: metadataDoc?.investigation || undefined,
Copy link
Contributor

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?

Copy link
Member Author

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.

@scytacki scytacki merged commit f268607 into master Sep 20, 2024
16 of 19 checks passed
@scytacki scytacki deleted the 188123062-live-update-sorted-docs branch September 20, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants