Skip to content

Fix a couple small issues I tripped over today. #2806

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 2 commits into from
Apr 11, 2019

Conversation

mikelehen
Copy link
Contributor

  1. Fix primeBackend so it uses an isolated FIRFirestore* instance. I ran into
    an issue where tests that try to change .settings would fail if they were the
    very first test run, since primeBackend had already configured the client and
    so settings could no longer be changed.
  2. FIRFirestore.client was incorrectly typed / commented as non-null.

1. Fix primeBackend so it uses an isolated FIRFirestore* instance. I ran into
   an issue where tests that try to change .settings would fail if they were the
   very first test run, since primeBackend had already configured the client and
   so settings could no longer be changed.
2. FIRFirestore.client was incorrectly typed / commented as non-null.
*/
- (FSTFirestoreClient *)client {
- (nullable FSTFirestoreClient *)client {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually desirable? The comment was wrong, but should anyone be accessing this before it's set up?

Why not assert that the client is non-null and then keep the nullability the way it was?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. Thanks for prodding me to be more holistic. :-) I ended up noticing that this is barely used and so I deleted it, but added the assert you wanted to api::Firestore.client() which was also missing it.

@wilhuff wilhuff assigned mikelehen and unassigned wilhuff Apr 11, 2019
@mikelehen mikelehen assigned wilhuff and unassigned mikelehen Apr 11, 2019
Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

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

LGTM

@wilhuff wilhuff changed the base branch from master to firestore-master April 11, 2019 17:33
@wilhuff wilhuff assigned mikelehen and unassigned wilhuff Apr 11, 2019
@wilhuff wilhuff merged commit 09010cf into firestore-master Apr 11, 2019
@wilhuff wilhuff deleted the mikelehen/misc-fixes branch April 11, 2019 17:41
Corrob pushed a commit that referenced this pull request Apr 25, 2019
* Fix a couple small issues I tripped over today.

1. Fix primeBackend so it uses an isolated FIRFirestore* instance. I ran into
   an issue where tests that try to change .settings would fail if they were the
   very first test run, since primeBackend had already configured the client and
   so settings could no longer be changed.
2. Remove FIRFirestore.client and make api::Firestore.client() assert client is configured.
@firebase firebase locked and limited conversation to collaborators Oct 17, 2019
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