Skip to content

Move ignoreIfPrimaryLeaseLoss to local_store.ts #2544

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
Jan 22, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

This breaks the dependency of SyncEngine and RemoteStore on indexeddb_persistence.ts and makes it easier to have a clean separation between 'yet-to-be-named-component' and 'firebase/firestore/persistence'.

Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

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

LGTM

@schmidt-sebastian
Copy link
Contributor Author

@wilhuff Can you re-approve?

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 as-is.

However, these pieces now seem a little scattered around. The error message is in persistence.ts, and the function is in local_store.ts. Would it make sense to make a lease.ts and consolidate everything we can over there? For example there's also PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG, which you didn't need to move but could.

@schmidt-sebastian
Copy link
Contributor Author

LGTM as-is.

However, these pieces now seem a little scattered around. The error message is in persistence.ts, and the function is in local_store.ts. Would it make sense to make a lease.ts and consolidate everything we can over there? For example there's also PRIMARY_LEASE_EXCLUSIVE_ERROR_MSG, which you didn't need to move but could.

ignorePrimaryLeaseIfLost is only ever used on the return value of LocalStore functions, so I thought it might be ok to move it to LocalStore. The error message however is very specific and to the Persistence API. I know this is not ideal, but the current state is the compromise that I came up with.

On top of that, I merged this before I saw your comment :) So for now I will leave as is.

@firebase firebase locked and limited conversation to collaborators Feb 22, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/moveignore branch February 28, 2020 23:03
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