Skip to content

Fix wasm binary sends causing Blob receives and leaks#69

Open
matte1 wants to merge 1 commit into
rerun-io:mainfrom
matte1:matte1/patch_memory_leak
Open

Fix wasm binary sends causing Blob receives and leaks#69
matte1 wants to merge 1 commit into
rerun-io:mainfrom
matte1:matte1/patch_memory_leak

Conversation

@matte1
Copy link
Copy Markdown

@matte1 matte1 commented Apr 27, 2026

The web backend was setting WebSocket.binaryType to Blob while sending WsMessage::Binary. That property only controls incoming message representation, so a binary send could force later binary receives through the Blob fallback instead of the intended ArrayBuffer path.

That fallback used FileReader with a forgotten closure per Blob message, so this could also leak memory over repeated binary receives.

Keep binary sends side-effect free, retain Blob FileReader callbacks only until loadend, and add wasm browser tests for both the binaryType regression and FileReader callback cleanup.

@matte1 matte1 force-pushed the matte1/patch_memory_leak branch from fcf5488 to e1bae72 Compare April 27, 2026 00:03
The web backend was setting WebSocket.binaryType to Blob while sending
WsMessage::Binary. That property only controls incoming message
representation, so a binary send could force later binary receives through
the Blob fallback instead of the intended ArrayBuffer path.

Keep binary sends side-effect free, retain Blob FileReader callbacks only
until loadend, and add wasm browser tests for both the binaryType regression
and FileReader callback cleanup.
Fix wasm binary sends causing Blob receives and leaks

The web backend was setting WebSocket.binaryType to Blob while sending
WsMessage::Binary. That property only controls incoming message
representation, so a binary send could force later binary receives through
the Blob fallback instead of the intended ArrayBuffer path.

That fallback used FileReader with a forgotten closure per Blob message,
so this could also leak memory over repeated binary receives.

Keep binary sends side-effect free, retain Blob FileReader callbacks only
until loadend, and add wasm browser tests for both the binaryType regression
and FileReader callback cleanup.
@matte1 matte1 force-pushed the matte1/patch_memory_leak branch from e1bae72 to 869ae8b Compare April 27, 2026 00:27
@c-git
Copy link
Copy Markdown
Collaborator

c-git commented Apr 27, 2026

Thanks, I'll take a look at it.

@c-git
Copy link
Copy Markdown
Collaborator

c-git commented May 7, 2026

Hi,

I have a few upcoming deadlines and apologize for the delay but likely I won't be able to get to this until around July. Sorry for the inconvenience. I want to thank you for the PR and I do appreciate it and will try to review it as soon as I can.

@matte1
Copy link
Copy Markdown
Author

matte1 commented May 8, 2026

No worries! I've patched this locally so I'm all good. I really enjoy all the (e)crates and appreciate y'alls work!

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.

2 participants