Skip to content

Fix webrtc example that relied on JSON integers#1171

Draft
goatchurchprime wants to merge 2 commits intogodotengine:masterfrom
goatchurchprime:gtch/webrtcjson
Draft

Fix webrtc example that relied on JSON integers#1171
goatchurchprime wants to merge 2 commits intogodotengine:masterfrom
goatchurchprime:gtch/webrtcjson

Conversation

@goatchurchprime
Copy link
Copy Markdown

This fixes the problem identified by godotengine/godot#103374

The JSON.parse_string() creates floats instead of integers from numbers, which the example flagged as an error. The solution is to send integers as strings instead.

@aaronfranke
Copy link
Copy Markdown
Member

Isn't this a workaround, not a solution? JSON numbers are, in fact, floats. Any check like str(msg.type).is_valid_int() in the ws_webrtc.client._parse_msg() function is just not a good check, right?

@Calinou Calinou added the bug label Mar 1, 2025
@fire fire changed the title fix webrtc example that relied on JSON integers Fix webrtc example that relied on JSON integers May 28, 2025
@aaronfranke aaronfranke added the waiting for godot PRs that can't be merged until an engine PR is merged first label Oct 2, 2025
@aaronfranke aaronfranke marked this pull request as draft October 2, 2025 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug needs work waiting for godot PRs that can't be merged until an engine PR is merged first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants