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

Switch to IndexedDb #121

Merged
merged 19 commits into from May 18, 2023
Merged

Switch to IndexedDb #121

merged 19 commits into from May 18, 2023

Conversation

Duddino
Copy link
Member

@Duddino Duddino commented Apr 20, 2023

Abstract

Switches to IndexedDb, compared to localStorage, it has the following features:

  • Larger capacity
  • Versioning system, so we can easily migrate
  • Ability to create one database per network, so we don't have to append -testnet to our keys anymore
  • Ability to store objects as opposed to strings
  • Handles simultaneous accesses (MPW open in multiple windows)
  • Async API, as to not block the UI
    have a better database than local storage, by having a larger capacity, a versioning system to easily update the database and doesn't block the UI.

@Duddino Duddino self-assigned this Apr 20, 2023
@Duddino Duddino added the Enhancement New feature or request label Apr 20, 2023
@Duddino Duddino marked this pull request as ready for review April 24, 2023 09:35
@Duddino Duddino changed the title [WIP] Switch to IndexedDb Switch to IndexedDb May 1, 2023
Liquid369
Liquid369 previously approved these changes May 9, 2023
Copy link

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK cba2b4f
Does as it is intended to, for now, can verify the storage, added MN, verified both networks available, and settings are stored.
Screenshot 2023-05-09 at 2 14 14 PM
Screenshot 2023-05-09 at 2 15 10 PM

Chrome & Safari

Copy link
Member

@JSKitty JSKitty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still able to replicate the 'Promise' issue, this time upon trying an Encrypted Import (an MPW encrypted legacy WIF, to be exact):

Uncaught (in promise) DOMException: Promise object could not be cloned.
    addAccount database.js:69
    InterpretGeneratorResume self-hosted:1819
    AsyncFunctionNext self-hosted:807
    (Async: async)
    guiImportWallet global.js:1159

@Duddino Duddino requested review from JSKitty and Liquid369 May 11, 2023 14:25
Copy link
Member

@JSKitty JSKitty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK e46e787.

I have tested everything I can think of - every single setting, every import type, with/without encryption, wiped the IndexedDB a billion times between each test, and also ran through the 'migration' many times by wiping IndexedDB while my localStorage data remained.

This is awesome! 🎉
LGTM, this will be a great futureproofing for MPW's 'heavier' capabilities in the future (i.e: Sapling Storage, or Block Headers, etc).

@JSKitty JSKitty requested a review from panleone May 12, 2023 16:22
@Duddino Duddino mentioned this pull request May 13, 2023
Copy link

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK e46e787
Still working 🔥

Copy link
Member

@panleone panleone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 77643aa really nice work

@JSKitty JSKitty merged commit 9355081 into PIVX-Labs:master May 18, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants