blockchainprojects / bitshares-ui

Graphical User Interface for BitShares Blockchain
https://wallet.bitshares.org
MIT License
0 stars 1 forks source link

Not loading in Firefox #79

Open sschiessl-bcp opened 5 years ago

sschiessl-bcp commented 5 years ago

Original issue #2437

Please investigate! Do you have that OS / Browser version available for testing? If not, browserstack account?

Estimate 4

VerevkinAlexander commented 5 years ago

@sschiessl-bcp The issue is present in Firefox in "private mode". I have checked on Ubuntu 18.04 and Windows 10. It's because of depending on IndexDB, which don't work in Firefox in "private mode". https://bugzilla.mozilla.org/show_bug.cgi?id=781982 Used polyfill "IndexedDBShim" depends on webSQL which is not supported by Firefox at all https://caniuse.com/#search=websql

sschiessl-bcp commented 5 years ago

Oh, I overlooked the private mode in the issue... Yea, then it is clear

sschiessl-bcp commented 5 years ago

If the user does not use local wallet the indexedDB should not be needed.

What part of the source initializes the indexedDB? I am wondering if it is possible to skip initiliazing if that exception is thrown and only allow Cloud login then.

What are your thoughts?

VerevkinAlexander commented 5 years ago

If the user does not use local wallet the indexedDB should not be needed.

What part of the source initializes the indexedDB? I am wondering if it is possible to skip initiliazing if that exception is thrown and only allow Cloud login then.

What are your thoughts?

@sschiessl-bcp It is initialized in WalletManagerStore and routerTransition and used in various stores http://joxi.ru/vAWbzkYU1w5DD2. I think it can be possible to skip initialization of indexDB, but it will require refactoring of stores. And can introduce some bugs.

sschiessl-bcp commented 5 years ago

First task:

Please refactor that the indexedDB is ONLY initialized in one central file (similar to what we did to https://github.com/blockchainprojects/bitshares-ui/issues/11 for localStorage).

Before actually changing anything we need to test if it works as expected.

Once that is done we can think about allowing it to load without an implementation and how to mock it up properly

VerevkinAlexander commented 5 years ago

@sschiessl-bcp Idb-instance has method for initialization, called "init_instance". It is used during wallet creation and after switching between web-socket nodes. So, basically, it's already initialized in one central file. Should I add method for blocking initialization or returning the mock in place of iDB? But this mock can get very "heavy".

sschiessl-bcp commented 5 years ago

Can you show the github permlink to that code please? Not on desktop atm

VerevkinAlexander commented 5 years ago

@sschiessl-bcp method for initialization: https://github.com/blockchainprojects/bitshares-ui/blob/3d3ad8e9ffdbebbaab673d57dc67c5cf9cb26ac4/app/idb-instance.js#L116

Init of indexDB instance: https://github.com/blockchainprojects/bitshares-ui/blob/3d3ad8e9ffdbebbaab673d57dc67c5cf9cb26ac4/app/routerTransition.js#L709 https://github.com/blockchainprojects/bitshares-ui/blob/3d3ad8e9ffdbebbaab673d57dc67c5cf9cb26ac4/app/stores/WalletManagerStore.js#L91