Skip to content

Commit

Permalink
fix(hermes): object-hash issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Oct 4, 2023
1 parent 3902715 commit 9f3ed29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion libraries/hermes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"build": "node_modules/.bin/rimraf dist && tsc",
"publish": "npm publish",
"postbuild": "copyfiles -u 1 src/*.proto src/**/*.json ./dist/"

},
"license": "ISC",
"dependencies": {
Expand All @@ -21,6 +20,7 @@
"@grpc/grpc-js": "^1.8.13",
"@grpc/proto-loader": "^0.7.6",
"@socket.io/redis-adapter": "^8.1.0",
"@types/object-hash": "^3.0.4",
"body-parser": "^1.20.2",
"cookie-parser": "~1.4.6",
"cors": "^2.8.5",
Expand Down Expand Up @@ -56,6 +56,7 @@
"@types/ioredis": "^4.28.10",
"@types/lodash": "^4.14.192",
"@types/node": "18.15.11",
"@types/object-hash": "^3.0.4",
"rimraf": "^5.0.0",
"typescript": "~5.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/hermes/src/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export abstract class ConduitRouter {
const routeKey = `${route.input.action}-${route.input.path}`;
if (this._registeredRoutes.has(routeKey)) {
return (
ObjectHash.sha1(route) !== ObjectHash.sha1(this._registeredRoutes.get(routeKey))
ObjectHash.sha1(route) !== ObjectHash.sha1(this._registeredRoutes.get(routeKey)!)
);
} else {
return true;
Expand Down
2 changes: 1 addition & 1 deletion libraries/hermes/src/Socket/Socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class SocketController extends ConduitRouter {
if (this._registeredNamespaces.has(namespace)) {
if (
ObjectHash.sha1(conduitSocket) !==
ObjectHash.sha1(this._registeredNamespaces.get(namespace))
ObjectHash.sha1(this._registeredNamespaces.get(namespace)!)
) {
this.removeNamespace(namespace);
if (this.metrics?.registeredRoutes) {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4649,6 +4649,11 @@
dependencies:
"@types/node" "*"

"@types/object-hash@^3.0.4":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@types/object-hash/-/object-hash-3.0.4.tgz#31865a3d69de1042fec2ede56fd8cf0bb4e01641"
integrity sha512-w4fEy2suq1bepUxHoJRCBHJz0vS5DPAYpSbcgNwOahljxwyJsiKmi8qyes2/TJc+4Avd7fsgP+ZgUuXZjPvdug==

"@types/otp-generator@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/otp-generator/-/otp-generator-4.0.0.tgz#da28b1e254f46262e176ba96541bcfa32660da98"
Expand Down

0 comments on commit 9f3ed29

Please sign in to comment.