Open rolznz opened 1 year ago
Also, the app unlock screen is stuck loading while slow connectors load. Ideally we should have a connector loading screen
Notes from @reneaaron
I always wondered why after a failed request with Alby (offline, 503 error, etc) I have to reload the extension before it starts to work again. Seems the the failed promise is stored in state.connector which was introduced with this commit. (this breaks every subsequent request done via the connector and prevents you e.g. from unloading, because the failed promise is cached and immediately returns)
Now I just stumbled upon Roland's PR to fix that for LNC and think this needs to be solved at the root of the problem. (and not in the connector individually)
Another issue: It's impossible to switch accounts / cancel loading of an account when one is currently loading. You have to wait for the account to fail loading before you can switch.
Notes from @reneaaron
I always wondered why after a failed request with Alby (offline, 503 error, etc) I have to reload the extension before it starts to work again. Seems the the failed promise is stored in state.connector which was introduced with this commit. (this breaks every subsequent request done via the connector and prevents you e.g. from unloading, because the failed promise is cached and immediately returns)
Now I just stumbled upon Roland's PR to fix that for LNC and think this needs to be solved at the root of the problem. (and not in the connector individually)
so, the same try /catch of lnc here? https://github.com/getAlby/lightning-browser-extension/blob/master/src/extension/background-script/state.ts#L112
@fczuardi that would be a good start (I think there is one other usage of connector.init() which would also need to have the same error handling)
Feature description
Currently we assume the connector init() function always works.
If the init() function doesn't work, the connector is left in a broken state, and multiple error toasts are displayed each time a call is requested (at least two - getinfo and invoices)
Describe the solution
I think we either should have a state where shows the connection failed, and the user can either retry or switch account. If the init fails or the connector disconnects at some point, we shouldn't still try to access the connector to get new data (which causes a cascading list of error messages)
Describe alternatives
No response
Additional context
No response
Are you working on this?
None