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

fix: Force loading the polyfills for setImmediate and clearImmediate (WEBAPP-5440) #4552

Merged
merged 1 commit into from Sep 11, 2018

Conversation

atomrc
Copy link
Contributor

@atomrc atomrc commented Sep 11, 2018

Ok, hold on to your socks, this is a tough one.

On the webapp side, we need (Dexie needs to be precise) both setImmediate and clearImmediate.
Dexies uses a polyfill to actually declare both of them if the browser doesn't have them.

So in the case of a browser setImmediate AND clearImmediate are not defined so Dexie's polyfill triggers and define both

In the case of the desktop app, we actually set ONLY setImmediate in the preload script (see https://github.com/wireapp/wire-desktop/blob/796ab90f104861697d0cd662b63b6c5836242d68/electron/renderer/static/webview-preload.js#L195).
Which means that when Dexie loads its polyfill, setImmediate is defined (but not clearImmediate) so the polyfill doesn't do anything and we end up in the bug we current have on the login page.

This fix, forces the webapp to load the polyfill for both setImmediate and clearImmediate (so Dexie's polyfill won't be loaded).

@atomrc
Copy link
Contributor Author

atomrc commented Sep 11, 2018

This could be a fix in 3 steps:

@atomrc atomrc merged commit 4685ea5 into dev Sep 11, 2018
@atomrc atomrc deleted the fix/landing_page_wrapper branch September 11, 2018 12:34
atomrc added a commit that referenced this pull request Sep 12, 2018
atomrc added a commit that referenced this pull request Sep 28, 2018
atomrc added a commit that referenced this pull request Oct 2, 2018
atomrc added a commit that referenced this pull request Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants