Skip to content

Commit

Permalink
fix(didcomm): Add didcomm packages as dependencies (hyperledger-ident…
Browse files Browse the repository at this point in the history
…us#60)

Signed-off-by: Francisco Javier Ribó Labrador <[email protected]>
  • Loading branch information
elribonazo committed May 2, 2024
1 parent 60237e0 commit dd80f8c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
16 changes: 6 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.1",
"@rollup/plugin-wasm": "^6.1.3",
"@scure/bip32": "^1.3.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
Expand Down Expand Up @@ -92,7 +91,6 @@
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"css-minimizer-webpack-plugin": "^4.2.2",
"didcomm-node": "^0.4.0",
"eslint": "^8.36.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5",
Expand Down Expand Up @@ -122,7 +120,6 @@
"semantic-release-slack-bot": "^3.5.3",
"sinon": "^15.0.1",
"sinon-chai": "^3.7.0",
"sql.js": "^1.8.0",
"sqlite3": "^5.1.6",
"stream-browserify": "^3.0.0",
"style-loader": "^3.3.1",
Expand All @@ -143,7 +140,9 @@
]
},
"dependencies": {
"sql.js": "^1.8.0",
"@scure/bip39": "^1.1.1",
"@scure/bip32": "^1.3.0",
"@stablelib/base64": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@stablelib/uuid": "^1.0.2",
Expand All @@ -155,7 +154,8 @@
"core-js": "^3.29.1",
"did-jwt": "^6.11.5",
"did-resolver": "^4.1.0",
"didcomm": "^0.4.0",
"didcomm": "^0.4.1",
"didcomm-node": "^0.4.1",
"elliptic": "^6.5.4",
"google-protobuf": "^3.21.2",
"hash.js": "1.1.7",
Expand Down
6 changes: 6 additions & 0 deletions src/prism-agent/connectionsManager/ConnectionsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ export class ConnectionsManager implements ConnectionsManagerClass {
this.events.emit(ListenerKey.MESSAGE, unreadMessages);
}
}, timeInterval);

this.cancellable.then().catch((err) => {
if (err instanceof Error) {
if (err.message !== "Task was cancelled") throw err;
} else throw err;
});
}

stopFetchingMessages(): void {
Expand Down
6 changes: 4 additions & 2 deletions src/prism-agent/helpers/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export class CancellableTask<T> {
constructor(task: Task<T>, repeatEvery?: number) {
this.controller = new AbortController();
this.cancellationToken = new Promise<T>((resolve, reject) => {
this.controller.signal.addEventListener("abort", () => {
const onAbort = () => {
this.controller.signal.removeEventListener("abort", onAbort);
reject(new Error("Task was cancelled"));
});
};
this.controller.signal.addEventListener("abort", onAbort);
if (repeatEvery !== undefined) {
this.period = Math.max(repeatEvery, 10);
this.loopOnTaskEvery(task, reject);
Expand Down

0 comments on commit dd80f8c

Please sign in to comment.