-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Change pushHash with stringified data #2397
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
Conversation
Current coverage is 92.47% (diff: 100%)@@ master #2397 diff @@
==========================================
Files 95 93 -2
Lines 10708 10622 -86
Methods 1309 1311 +2
Messages 0 0
Branches 1741 1727 -14
==========================================
- Hits 9835 9823 -12
+ Misses 873 799 -74
Partials 0 0
|
@alenoir updated the pull request. |
1 similar comment
@alenoir updated the pull request. |
@alenoir updated the pull request. |
@alenoir updated the pull request. |
as we said in 676d2e2 i replace payloadstring by stringify data.alert for localization format |
the same for me.
|
This should be merged soon... All iOS localized push will fail on version |
@@ -36,7 +36,7 @@ export default function pushStatusHandler(config) { | |||
expiry: body.expiration_time, | |||
status: "pending", | |||
numSent: 0, | |||
pushHash: md5Hash(data.alert || ''), | |||
pushHash: md5Hash(JSON.stringify(data.alert) || ''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the case alert is a string, that will wrap the string into another string, including the quotes...
This should be updated to:
let pushHash;
if (typeof data.alert === 'string') {
pushHash = md5Hash(data.alert);
} else if (typeof data.alert === 'object') {
pushHash = md5Hash(JSON.stringify(data.alert));
} else {
pushHash = "d41d8cd98f00b204e9800998ecf8427e"; // empty string hash
}
thanks @alenoir. Tests would have been nice too. |
@alenoir updated the pull request. |
1 similar comment
@alenoir updated the pull request. |
Thanks @alenoir, merging after travis |
Notification with
loc-key
andloc-args
crash becausedata.alert
is not a string.e.g.