Change pushHash with stringified data#2397
Change pushHash with stringified data#2397flovilmart merged 4 commits intoparse-community:masterfrom
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 |
| status: "pending", | ||
| numSent: 0, | ||
| pushHash: md5Hash(data.alert || ''), | ||
| pushHash: md5Hash(JSON.stringify(data.alert) || ''), |
There was a problem hiding this comment.
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-keyandloc-argscrash becausedata.alertis not a string.e.g.