sphinx-relay/protobuf_long.patch
Antoni Spaanderman a8658b8b4a
grpc -> grpcjs + generated ts types from proto files
notes:
 * grpcjs doesnt like ByteBuffer, it has been replaced with the nodejs
   native Buffer
 * grpcjs doesnt like calls without an argument, add {} instead
   see src/grpc/subscribe.ts:24
 * grpcjs converts uint64 in a map key (map<uint64, ...>) to some hash,
   this is fixed with protobuf_long.patch which is automatically applied
   after running `npm install`
   this pr would fix the bug upstream https://github.com/protobufjs/protobuf.js/pull/1669
2023-02-17 21:37:59 +01:00

13 lines
601 B
Diff

diff --git a/node_modules/protobufjs/src/decoder.js b/node_modules/protobufjs/src/decoder.js
index 491dd30..cfaa927 100644
--- a/node_modules/protobufjs/src/decoder.js
+++ b/node_modules/protobufjs/src/decoder.js
@@ -72,7 +72,7 @@ function decoder(mtype) {
("}");
if (types.long[field.keyType] !== undefined) gen
- ("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref);
+ ("%s[util.Long.isLong(k)?k.toString():typeof k===\"object\"?util.longToHash(k):k]=value", ref);
else gen
("%s[k]=value", ref);