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

Add ConnectivityMonitor #1808

Merged
merged 8 commits into from
May 21, 2019
Merged

Add ConnectivityMonitor #1808

merged 8 commits into from
May 21, 2019

Conversation

thebrianchen
Copy link

No description provided.

@thebrianchen thebrianchen requested review from wilhuff and removed request for hiranya911, Feiyang1 and hsubox76 May 21, 2019 00:29
@wilhuff wilhuff assigned thebrianchen and unassigned wilhuff May 21, 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

* that each platform will have its own system-dependent implementation.
*/
export interface ConnectivityMonitor {
addCallback(callback: ConnectivityMonitorCallback): void;
Copy link
Contributor

Choose a reason for hiding this comment

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

More comments on what these do please.

Specifically, does the callback get called on the initial state?

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

Just as a note, we ended up disabling online/offline monitoring for RTDB on Cordova (

// We've had repeated complaints that Cordova apps can get stuck "offline", e.g.
) due to bugginess. That was years ago, so hopefully the problem is resolved... but I just wanted to mention it so it's on your radar just in case we get complaints about connection issues on Cordova after this releases.

@thebrianchen thebrianchen merged commit df1b588 into master May 21, 2019
@thebrianchen thebrianchen deleted the bc/connect branch May 21, 2019 21:39
}

private configureNetworkMonitoring(): void {
window.addEventListener('online', this.networkAvailableListener);
Copy link
Contributor

Choose a reason for hiding this comment

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

@thebrianchen I believe we need to fix this still as per our earlier discussion.

Ideally, you would change BrowserWindow to only return BrowserConnectivityMonitor if window is defined. The smaller fix would be to add a typeof window !== undefined check here. As merged, I believe this change will cause issues on Electron and other browser-like environments.

Copy link

@rauldeheer rauldeheer May 27, 2019

Choose a reason for hiding this comment

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

This is probably causing issue #1824.

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.

5 participants