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: reset wallet manager to ensure correct generation of new accounts #1188

Merged
merged 14 commits into from
Mar 28, 2024

Conversation

helciofranco
Copy link
Member

Previously, Wallet Manager was failing to clear properly when db.clear(); is called.

This led to wrong account addresses generation, as updates to the IndexedDB didn't reflect in the Wallet Manager's internal state, particularly the #vaults property.

To resolve this issue, I implemented a manual call to removeVault during logout.

This ensures that each new wallet generated starts from scratch, free from interference by any previous mnemonic vault.

@helciofranco helciofranco self-assigned this Mar 25, 2024
@helciofranco helciofranco added the bug Something isn't working label Mar 25, 2024
@helciofranco helciofranco marked this pull request as ready for review March 25, 2024 21:31
Copy link
Contributor

github-actions bot commented Mar 25, 2024

Coverage report for ./packages/app

St.
Category Percentage Covered / Total
🟡 Statements 64.14% 3268/5095
🔴 Branches 41.02% 587/1431
🔴 Functions 47.83% 683/1428
🟡 Lines 64.68% 3151/4872

Test suite run success

236 tests passing in 72 suites.

Report generated by 🧪jest coverage report action from 5ee9560

@helciofranco helciofranco merged commit d51591e into master Mar 28, 2024
13 checks passed
@helciofranco helciofranco deleted the hf/fix/vault-id branch March 28, 2024 23:00
luizstacio pushed a commit that referenced this pull request Apr 11, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to master, this PR will be updated.


# Releases
## fuels-wallet@0.16.2

### Patch Changes

- [#1113](#1113)
[`3c5d91d`](3c5d91d)
Thanks [@helciofranco](https://github.com/helciofranco)! - chore: update
ts-sdk and fuel-ui packages

- [#1198](#1198)
[`7fac95e`](7fac95e)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1218](#1218)
[`616f091`](616f091)
Thanks [@arthurgeron](https://github.com/arthurgeron)! - Fixes Approve
Transaction screen staying in a partially loading state after approving
a transaction

- [#1196](#1196)
[`1427f2b`](1427f2b)
Thanks [@helciofranco](https://github.com/helciofranco)! - fix:
transaction id available on transaction approved page, it was taking the
user to a broken page (undefined id).

- [#1170](#1170)
[`aa684b3`](aa684b3)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1217](#1217)
[`8f94aee`](8f94aee)
Thanks [@arthurgeron](https://github.com/arthurgeron)! - Prevent the
Change Password dialog from allowing the new password to be the same as
the current password #1203

- [#1137](#1137)
[`a0e5cbf`](a0e5cbf)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: replace
prettier and eslint with biomejs (dev)

- [#1197](#1197)
[`97a8a3c`](97a8a3c)
Thanks [@helciofranco](https://github.com/helciofranco)! - - Display the
full app URL when it's big (instead of truncating it).

- Sync the information displayed in the connected app `list` and `edit`
screens.
- Improve how the URL are displayed, focusing on the `hostname` mostly.
- Display only the first two initials on the Avatar when the page has a
long title (2+ words).

- [#1186](#1186)
[`45f6571`](45f6571)
Thanks [@helciofranco](https://github.com/helciofranco)! - chore:
replaces a warning icon (orange) with a info icon (gray) from the
connection list screen.

- [#1210](#1210)
[`0fa1abc`](0fa1abc)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1141](#1141)
[`96faa7f`](96faa7f)
Thanks [@helciofranco](https://github.com/helciofranco)! - feat: bump
SDK to latest version

- [#1188](#1188)
[`d51591e`](d51591e)
Thanks [@helciofranco](https://github.com/helciofranco)! - Previously,
`Wallet Manager` was failing to clear properly when `db.clear();` is
called.

This led to wrong account addresses generation, as updates to the
`IndexedDB` didn't reflect in the Wallet Manager's internal state,
particularly the `#vaults` property.

To resolve this issue, I implemented a manual call to `removeVault`
during logout.

This ensures that each new wallet generated starts from scratch, free
from interference by any previous mnemonic vault.

- [#1150](#1150)
[`c0d8def`](c0d8def)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: enable
biomejs rules (as it was with eslint and prettier)

- [#1182](#1182)
[`ddb2440`](ddb2440)
Thanks [@helciofranco](https://github.com/helciofranco)! - fix: disable
autocomplete from the private key input.

- Updated dependencies
\[[`3c5d91d`](3c5d91d),
[`aa684b3`](aa684b3),
[`a0e5cbf`](a0e5cbf),
[`ec58815`](ec58815),
[`0fa1abc`](0fa1abc),
[`96faa7f`](96faa7f),
[`c0d8def`](c0d8def)]:
    -   @fuel-wallet/connections@0.16.2

## @fuel-wallet/connections@0.16.2

### Patch Changes

- [#1113](#1113)
[`3c5d91d`](3c5d91d)
Thanks [@helciofranco](https://github.com/helciofranco)! - chore: update
ts-sdk and fuel-ui packages

- [#1170](#1170)
[`aa684b3`](aa684b3)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1137](#1137)
[`a0e5cbf`](a0e5cbf)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: replace
prettier and eslint with biomejs (dev)

- [#1165](#1165)
[`ec58815`](ec58815)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: make
connections and types packages private
we don't need to use publish them anymore because it's going to be used
only by the CRX

- [#1210](#1210)
[`0fa1abc`](0fa1abc)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1141](#1141)
[`96faa7f`](96faa7f)
Thanks [@helciofranco](https://github.com/helciofranco)! - feat: bump
SDK to latest version

- [#1150](#1150)
[`c0d8def`](c0d8def)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: enable
biomejs rules (as it was with eslint and prettier)

- Updated dependencies
\[[`3c5d91d`](3c5d91d),
[`aa684b3`](aa684b3),
[`a0e5cbf`](a0e5cbf),
[`ec58815`](ec58815),
[`0fa1abc`](0fa1abc),
[`96faa7f`](96faa7f),
[`c0d8def`](c0d8def)]:
    -   @fuel-wallet/types@0.16.2

## @fuel-wallet/types@0.16.2

### Patch Changes

- [#1113](#1113)
[`3c5d91d`](3c5d91d)
Thanks [@helciofranco](https://github.com/helciofranco)! - chore: update
ts-sdk and fuel-ui packages

- [#1170](#1170)
[`aa684b3`](aa684b3)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1137](#1137)
[`a0e5cbf`](a0e5cbf)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: replace
prettier and eslint with biomejs (dev)

- [#1165](#1165)
[`ec58815`](ec58815)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: make
connections and types packages private
we don't need to use publish them anymore because it's going to be used
only by the CRX

- [#1210](#1210)
[`0fa1abc`](0fa1abc)
Thanks [@fuel-service-user](https://github.com/fuel-service-user)! - ci:
update to tag latest

- [#1141](#1141)
[`96faa7f`](96faa7f)
Thanks [@helciofranco](https://github.com/helciofranco)! - feat: bump
SDK to latest version

- [#1150](#1150)
[`c0d8def`](c0d8def)
Thanks [@helciofranco](https://github.com/helciofranco)! - ci: enable
biomejs rules (as it was with eslint and prettier)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants