-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Just flagging this for later and adding the context. There seems to be an issue with how Objective-C is decoding base64 strings in the RN bridge method addData:
- This is the same weirdness we saw with
pb.Strings - The actual error we saw is from hitting the textile JSON mill with invalid JSON:
error adding data (\351\307\370\272&start","target":"P7W358aNqdqeYFCSQJL5LobnKYfcQRaXMPogafxkE4sWHokf","duration":86400}: invalid character '(' looking for beginning of value
There seems to be some additional characters added to the start of the string (looks sorta like ASCII, but not quite?).
As a temp fix, we're just passing an encoded string all the way down to the textile lib. However, this should not effect the user TS API, which can internally encode the Buffer to base64 and pass the result to the RN bridge. This makes for a nicer API (the user should not need to deal with base64):
addData(Buffer.from(myString), <threadID>, <caption>)
vs.
addData(Buffer.from(myString).toString('base64'), <threadID>, <caption>)
This would still work with the current temporary fix in the RN bridge, because the issue is not with the JS Buffer module.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels