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

build: agent-js v0.13.2 with idb breaking change #1247

Merged
merged 28 commits into from Aug 24, 2022

Conversation

peterpeterparker
Copy link
Member

@peterpeterparker peterpeterparker commented Aug 15, 2022

Motivation

agent-js v0.13.x introduces a breaking change. It uses indexeddb instead of local storage to save the session delegation and identity.

Indexddb is awesome and it's the most convenient way to access these information from web workers which we are already using for the cron that checks the delegation and which we might use for more features in the future.

⚠️ Important Note ⚠️

  • on logout, local storage is not going cleared anymore but idb instead
  • we don't explicitly clear idb but defer the work to agent-js which do so
  • instead of syncing the auth on local storage changes, the identity will be checked in the auth cron

Dependencies

fake-indexeddb (https://github.com/dumbmatter/fakeIndexedDB) has been added to mock idb for jest tests happening in the nodejs context

PRs required

Changes

  • in web worker, read delegation from idb instead of localstorage to check the validity of the delegation
  • in web worker, also check the auth is authenticated
  • on logout, do not clear local storage
  • mock idb for test with new dev dependency fake-indexeddb
  • remove auth sync on local storage changes
  • bump agent-js v0.13.2
  • bump most recent nns-js, sns-js and utils-js

peterpeterparker and others added 4 commits August 15, 2022 07:12
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
@peterpeterparker peterpeterparker marked this pull request as ready for review August 16, 2022 05:23
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
@peterpeterparker peterpeterparker removed the request for review from lmuntaner August 16, 2022 06:14
@peterpeterparker peterpeterparker marked this pull request as draft August 16, 2022 06:14
peterpeterparker and others added 7 commits August 16, 2022 08:14
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
@peterpeterparker peterpeterparker marked this pull request as ready for review August 16, 2022 06:40
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Formatting Committer and others added 7 commits August 16, 2022 07:27
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
@peterpeterparker peterpeterparker changed the title build: agent-js v0.13.1 with idb breaking change build: agent-js v0.13.2 with idb breaking change Aug 23, 2022
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Signed-off-by: David Dal Busco <david.dalbusco@dfinity.org>
Copy link
Contributor

@lmuntaner lmuntaner left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments but already approving.

frontend/package.json Show resolved Hide resolved
frontend/src/lib/components/common/Guard.svelte Outdated Show resolved Hide resolved
frontend/src/lib/workers/auth.worker.ts Show resolved Hide resolved
@peterpeterparker peterpeterparker merged commit 50f52ee into main Aug 24, 2022
@peterpeterparker peterpeterparker deleted the build/agent-js-indexeddb branch August 24, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants