Undocumented Serialization of Instance Table Keys using RemoteEvents

Page URL: Bindable Events and Functions | Roblox Creator Documentation
Impact: Moderate
Frequency: Constantly
Date First Experienced: 2021-03-27 16:03:00 (-07:00)
Date Last Experienced: 2021-03-27 17:03:00 (-07:00)

Reproduction Steps:
This is less a bug and more a case of inaccurate documentation. The Developer Hub does not mention that table keys of type Instance get serialized to strings through the RemoteEvent, which causes unexpected behavior for developers to contend with. I’ve created a minimum repro here: RemoteEvents Unexpected Behavior Repro - Roblox. This repro simply fires a RemoteEvent from the server to the client once a second. Before it fires the event, it prints the keys and values of the table it will send to the client and the types of each of those keys and values. Once the client gets word of the event, it will print the keys and values and types of the keys and values of the table it receives as an argument from the event. The server’s keys and values are both of type Instance, but the client sees keys of type string and values of type Instance.

Expected Behavior:
In this particular case, I would have expected either the game engine to not serialize my table values or at least for the Developer Hub to list that in the linked page’s “Parameter Limitations” section.

Actual Behavior:
The linked page makes no reference to the behavior of the game engine.

Workaround:

7 Likes

Found out about this today too! Functions in table not getting passed through with a RemoteFunction

2 Likes

This is a duplicate.

1 Like

And two months later we still don’t have a paragraph mentioning this? :thinking:

1 Like

Hey,

Thanks for the report! I’m looking here, and I notice the following section:

Non-String Indices
If any indices of a passed table are non-string type ( Instance , userdata, function, another table, etc.), those indices will be converted to a string.

Does that resolve the issue you raise?

Thanks

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.