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
Problem can be replicated with following data structure:
filter_metadata: {'key1': {key2: 'data'},},
for map<string, google.protobuf.Struct> filter_metadata = 1;
Encoding this structure causes stack overflow as data is wrapped multiple times in encoding process with Struct.wrap wrapping already wrapped data again and again causing recursive loop.
This generates following structure; this example is after only few iterations:
cc @ZimGil if you'd like to take a look, @jokerttu would also be great if you want to dig in; I can put it on my todo list but it might be a little while before I have time to look in to it.
Hi @jokerttu@stephenh , I’m having the same issue with Struct and Value 😞 Any updates on this? (Versions: "ts-proto": "^2.2.5", "ts-protoc-gen": "^0.15.0")
Maximum call stack size exceeded
error while encoding.google.protobuf.Struct
data.Related to this PR: #762
For following proto structure:
Generated .pb.ts type for filter_metadata:
Encoders:
Metadata::
Metadata_FilterMetadataEntry:
Struct:
Struct_FieldsEntry:
Value:
Problem can be replicated with following data structure:
for
map<string, google.protobuf.Struct> filter_metadata = 1;
Encoding this structure causes stack overflow as data is wrapped multiple times in encoding process with
Struct.wrap
wrapping already wrapped data again and again causing recursive loop.This generates following structure; this example is after only few iterations:
Hotfixed this in generated proto.pd.ts file by changing Struct_FieldsEntry encode function from
to
as message should be in Struct format in this step already.
Most probably this could break some other use cases (with deeply nested values maybe), but at least this fixed encoding with data structure above.
The text was updated successfully, but these errors were encountered: