Open taoeffect opened 2 months ago
Fixing the 2nd problem that happens after refreshing the page seems very difficult because it's likely a browser bug.
After using the debugger @corrideat and I were able to narrow it down to these lines:
main.js
:
// Now that the app is ready, we proceed to call /login (which will restore
// the user's session, if they are already logged in)
// Since this is asynchronous, we must check this.ephemeral.finishedLogin
// to ensure that we don't override user interactions that have already
// happened (an example where things can happen this quickly is in the
// tests).
sbp('gi.db/settings/load', SETTING_CURRENT_USER).then(identityContractID => {
And then it's getting stuck waiting on the promise returned by 'gi.db/settings/load'
(in frontend/model/database.js
) which is waiting on IndexedDB
:
'gi.db/settings/load': function (user ) {
return appSettings.getItem(user)
},
I also couldn't view the IndexedDB in the developer tools, clicking on it did nothing:
It seems like a browser bug in either localforage
, or more likely Brave or Chromium.
FWIW @corrideat removes localforage in #2137, but I don't think that will fix this issue since it's likely a browser bug. 😕
Problem
In a private window I joined a new user to the testing group that was running 0.6.0:
Below you can see there's a deadlock in the invocation queue, and you can also see an error at the bottom that appeared after @corrideat joined another user to the group while this deadlock was happening:
Here is the stuck queue itself:
The anonymous async function for the 2nd broken queue (the one for the identity contract that has
chelonia/private/invoke
stuck) is from here ininternals.js
:The first stuck queue is the group contractID:
The second stuck queue is the identity contract of the user that just joined (my test user that got stuck):
Refreshing the page results in a spinning group income spinner and no error logs. Unregistering the service worker and refreshing again still results in the same problem:
The console logs with
/app/?debug=true
:Solution
Identify the deadlock that happens on joining the group and fix.