Skip to content

Don't drop forwarded SMS with missing optional fields - #38

Open
yonatan-genai wants to merge 1 commit into
OpenBubbles:masterfrom
yonatan-genai:upstream-sms-parsing
Open

yonatan-genai wants to merge 1 commit into
OpenBubbles:masterfrom
yonatan-genai:upstream-sms-parsing

Conversation

@yonatan-genai

Copy link
Copy Markdown

I'm running rustpush as a headless SMS-forwarding receiver and noticed forwarded SMS from alphanumeric senders (bank and OTP senders) sometimes never showed up. RawSmsIncomingMessage required every field, so a payload missing any of them failed to deserialize and the message was dropped with no log, and parse_sms could panic on an fh entry that didn't match k or on a body that wasn't valid UTF-8.

This makes the optional fields default, falls back to k order when fh doesn't match, and decodes the body lossily. Added tests for a full payload, a payload with only h/k/g/w, and a mismatched fh.

RawSmsIncomingMessage required every field it knows about (fco, co, fh,
cs, r, _ssc, l, sV, m, ic). If one was missing, deserialization failed,
from_raw fell through to BadMsg and the SMS vanished with no log. Only
h, k, g and w are needed to show the message, so the rest now default.

parse_sms also unwrapped the fh -> k lookup and the UTF-8 decode, so an
fh that didn't match k, or a non-UTF-8 body, panicked. It now falls back
to k order and decodes lossily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant