Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while processing prekey response #25

Closed
liliakai opened this issue May 13, 2014 · 2 comments
Closed

Exception while processing prekey response #25

liliakai opened this issue May 13, 2014 · 2 comments

Comments

@liliakai
Copy link
Contributor

When requesting prekeys for recipient from the server, the response comes back successful, but saveDeviceObject throws "unsure of how to jsonify object of type undefined", which is caught and converted into "Failed to retreive new device keys for number".

I think the undefined is coming from response[i].registrationId on L486 of helpers.js.

@TheBlueMatt
Copy link
Contributor

Cant reproduce on master, can you double-check and/or fix?

@liliakai
Copy link
Contributor Author

definitely an issue with jsonifying undefined registration ids. i can only send messages if i delete them. will dig in a little more later tonight.

diff --git a/js/helpers.js b/js/helpers.js
index 18c4aca..ce98442 100644
--- a/js/helpers.js
+++ b/js/helpers.js
@@ -480,8 +480,7 @@ function getKeysForNumber(number) {
                 encodedNumber: number + "." + response[i].deviceId,
                 identityKey: response[i].identityKey,
                 publicKey: response[i].publicKey,
-                preKeyId: response[i].keyId,
-                registrationId: response[i].registrationId
+                preKeyId: response[i].keyId
             });
         }
         return response[0].identityKey;
@@ -500,7 +499,6 @@ function sendMessageToDevices(number, deviceObjectList, message, success_callbac
             jsonData[i] = {
                 type: encryptedMsg.type,
                 destination: deviceObjectList[i].encodedNumber,
-                destinationRegistrationId: deviceObjectList[i].registrationId,
                 body: encryptedMsg.body,
                 timestamp: new Date().getTime()
             };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants