Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: agent-js v0.13.2 with idb breaking change (#1247)
# 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 - [X] ic-js PR dfinity/ic-js#177 - [x] agent-js PR dfinity/agent-js#611 - [x] agent-js PR dfinity/agent-js#612 # 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
- Loading branch information
1 parent
6d636c2
commit 50f52ee
Showing
15 changed files
with
691 additions
and
552 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
import type { LocalStorageAuth } from "./auth"; | ||
|
||
export interface PostMessageEventData { | ||
msg: "nnsStartIdleTimer" | "nnsStopIdleTimer" | "nnsSignOut"; | ||
data?: LocalStorageAuth; | ||
} |
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
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
Oops, something went wrong.