-
Notifications
You must be signed in to change notification settings - Fork 1
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
use predictions v2 and fix bug in decodeRawMessage #550
Conversation
val payloadJson = message.removeRange(message.length - 1, message.length) // remove ']' | ||
val payloadJson = message[4].toString() |
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.
I'm nervous about the performance impact of turning this back into a JSON string just so that we can parse it again as JSON a few moments later, but I'm not really sure how straightforward it'd be to avoid that, so it shouldn't have to block this PR.
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.
Sure, I don't expect it'll be an issue but I'm digging into Android performance again so I'll keep this in mind as a potential problem. Can always revisit.
} | ||
} | ||
val message = Json.parseToJsonElement(rawMessage).jsonArray | ||
val joinRef = message[0].jsonPrimitive.content |
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.
Per the JsonPrimitive.content
docs, content
will be "null"
if the value is null
, and contentOrNull
is the correct way to get null
from null
. (The Kotlin serialization library stores JSON internally in a weird half-hydrated state that is optimized specifically for serialization and deserialization more than for in-memory processing, which I learned way too much about as part of FeatureProperties.)
d2f5a68
to
f55ecb0
Compare
Summary
Ticket: Use predictions v2 channel in Android app
What is this PR for?
Use the same, more scalable endpoint as iOS for the predictions real time data. This PR also fixes a parsing issue with the
decodeRawMessage
function.Testing
What testing have you done?