diff --git a/package-lock.json b/package-lock.json index 6df36f5..721f4b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@waku/react-native", - "version": "0.0.9", + "version": "0.0.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@waku/react-native", - "version": "0.0.9", + "version": "0.0.11", "license": "MIT", "dependencies": { "base-64": "^1.0.0", diff --git a/package.json b/package.json index 0900818..37fe5c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@waku/react-native", - "version": "0.0.10", + "version": "0.0.11", "description": "Waku React Native", "author": "Status Research & Development GMBH", "authors": [ diff --git a/src/index.tsx b/src/index.tsx index 6055d55..6004ea4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -166,7 +166,10 @@ export function relayPublish( timeoutMs: Number = 0 ): Promise { return new Promise(async (resolve, reject) => { - let messageJSON = JSON.stringify(msg); + let messageJSON = JSON.stringify(msg).replace( + /"timestamp":"([0-9]+)"/, + `"timestamp":$1` + ); let response = JSON.parse( await ReactNative.relayPublish(messageJSON, pubsubTopic, timeoutMs) ); @@ -516,7 +519,10 @@ export function lightpushPublish( timeoutMs: Number = 0 ): Promise { return new Promise(async (resolve, reject) => { - let messageJSON = JSON.stringify(msg); + let messageJSON = JSON.stringify(msg).replace( + /"timestamp":"([0-9]+)"/, + `"timestamp":$1` + ); let response = JSON.parse( await ReactNative.lightpushPublish( messageJSON, @@ -722,7 +728,9 @@ export function storeQuery( ? bigInt(query.endTime.valueOf()).multiply(OneMillion).toString(10) : 0, pagingOptions: query.pagingOptions, - }); + }) + .replace(/"startTime":"([0-9]+)"/, `"startTime":$1`) + .replace(/"endTime":"([0-9]+)"/, `"endTime":$1`); let response = JSON.parse( await ReactNative.storeQuery(queryJSON, peerID, timeoutMs) );