Skip to content

Standardize shutdown checking logic #1776

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 3 commits into from
May 9, 2019
Merged

Standardize shutdown checking logic #1776

merged 3 commits into from
May 9, 2019

Conversation

thebrianchen
Copy link

No description provided.

@wilhuff wilhuff assigned thebrianchen and unassigned wilhuff May 9, 2019
@thebrianchen thebrianchen assigned wilhuff and unassigned thebrianchen May 9, 2019
// PORTING NOTE: LocalStore does not need an explicit shutdown on web.
if (this.lruScheduler) {
this.lruScheduler.stop();
if (this.isShutdown === false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it imperative that this value be strictly checked against false? If not, I'd consider the simpler if (!this.isShutdown).

Looking through our source the convention seems to heavily favor the simpler form:

grep -r 'if (!' packages/firestore/src | wc -l   # => 158
grep -r '=== false' packages/firestore/src | wc -l  # => 2

If strictness really is required, please comment on why because this seems like something to fix.

@wilhuff wilhuff assigned thebrianchen and unassigned wilhuff May 9, 2019
@thebrianchen thebrianchen assigned wilhuff and unassigned thebrianchen May 9, 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

@thebrianchen thebrianchen merged commit c0ab7b4 into master May 9, 2019
@thebrianchen thebrianchen deleted the bc/shutdown branch May 9, 2019 23:05
@firebase firebase locked and limited conversation to collaborators Oct 11, 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.

2 participants