forked from FuelLabs/fuels-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: vault server lock propagation (FuelLabs#1280)
## Context `useUnlock` listens for `lock` and `unlock` events from VaultClient, but the communication with VaultServer was one-way, meaning those events from the Server never reached the client. That means that a lock changes from server-side would never be reflected in our UI. In that scenario the wallet locks but the user wouldn't be redirected to the auth screen, being able to keep interacting with UI elements behind the auth guard, leading to several bugs. ## Solution Fixed by using propagating VaultServer lock change events to VaultClient through existing communication protocol, VaultClient further propagates those events, which are now correctly handled by `useUnlock`, leading to proper behavior (e.g. redirection to the auth screen). ## Evidence ### Before https://github.com/FuelLabs/fuels-wallet/assets/3487334/c85944cc-fe7e-4a62-a670-4414d790dc98 ### After https://github.com/FuelLabs/fuels-wallet/assets/3487334/1de77275-b18d-474f-b3bb-e32153832d2e --------- Co-authored-by: Luiz Estácio | stacio.eth <[email protected]>
- Loading branch information
1 parent
85f062c
commit 6e94172
Showing
4 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fuels-wallet": patch | ||
--- | ||
|
||
vault client not propagating lock unlock events from server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters