Skip to content

Use immutable Documents in MemoryRemoteDocumentCache #3225

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

Merged
merged 5 commits into from
Dec 9, 2021

Conversation

schmidt-sebastian
Copy link
Contributor

This is a small refactor that makes it possible to ensure via compile-time checks that we never return a Document directly from the RemoteDocumentCache. Instead, we must call clone().

@@ -31,14 +33,14 @@
final class MemoryRemoteDocumentCache implements RemoteDocumentCache {

/** Underlying cache of documents and their read times. */
private ImmutableSortedMap<DocumentKey, MutableDocument> docs;
private ImmutableSortedMap<DocumentKey, Document> docs;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 8, 2021

Coverage Report

Affected SDKs

  • firebase-firestore

    SDK overall coverage did not change between base commit (7d86138) and head commit (23f2af6e). However there are changes in individual files.

    Filename Base (7d86138) Head (23f2af6e) Diff
    DeleteMutation.java 95.00% 90.00% -5.00%
    PatchMutation.java 98.39% 100.00% +1.61%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (23f2af6e) is created by Prow via merging commits: 7d86138 636d9c9.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 8, 2021

Binary Size Report

Affected SDKs

  • firebase-firestore

    Type Base (7d86138) Head (23f2af6e) Diff
    aar 1.23 MB 1.23 MB -71 B (-0.0%)
    apk (release) 3.33 MB 3.33 MB +104 B (+0.0%)

Test Logs

Notes

Head commit (23f2af6e) is created by Prow via merging commits: 7d86138 636d9c9.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 9, 2021

@schmidt-sebastian: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests 636d9c9 link /test smoke-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@schmidt-sebastian schmidt-sebastian merged commit 70864ca into master Dec 9, 2021
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/rdcmutable branch December 9, 2021 16:21
@firebase firebase locked and limited conversation to collaborators Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants