You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
onMessage calls the callback twice, with the raw string, when the callback throws #502
If the callback throws while it handles a valid JSON message, the catch branch runs the callback again with the unparsed string as data, and the original error is discarded.
Steps to reproduce
Subscribe with a callback that throws, for example ReactNativeBrownfield.onMessage(() => { throw new Error('boom'); }).
From the native host, post a JSON message such as {"type":"login"}.
Expected behavior
The callback runs once with data set to { type: 'login' }, and the boom error surfaces.
Actual behavior
The callback runs twice: first with { type: 'login' }, then with the string '{"type":"login"}'. The boom error from the first call is swallowed. Handlers that are not idempotent run their side effects twice, and the second call usually fails with a different, misleading error.
Activity