messagix/bloks: handle string/bool/nil in i64.Convert - #343
Open
trevornk wants to merge 1 commit into
Open
Conversation
Meta's 2FA screen during Messenger Lite login invokes bk.action.i64.Convert with string, bool, and null arguments, not just int64/float64. The interpreter only handled the two numeric cases and returned an error for anything else, aborting login right after the password step whenever the 2FA flow passed a non-numeric type. Add handling for numeric strings (including float-formatted strings like "3.0"), bool (true/false -> 1/0), and nil (-> 0), matching the apparent semantics of Meta's own Bloks runtime. Non-numeric strings still return an error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meta's Messenger Lite login flow calls
bk.action.i64.Convertfrom the two-step verification (2FA) screen. The interpreter's current implementation only handlesint64andfloat64arguments, returningcan't convert %T to i64for anything else. In practice, some steps in the 2FA Bloks flow pass string, bool, or null values into this function, which aborts login right after the password step whenever that happens.This adds handling for:
"3.0"bool(true/false->1/0)nil(->0)Non-numeric strings still return an error, same as before.
We've been running this patch locally for a stretch as a workaround for logins getting stuck on this exact error during 2FA, and it's resolved it cleanly with no observed regressions. Included a table-driven test covering all the new cases plus the existing numeric passthrough behavior.