GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
541 stars 77 forks source link

[BUG] Proto field is not repeating, cannot start list. #360

Closed shafnaz closed 1 year ago

shafnaz commented 1 year ago

Describe the bug I'm sending data using add_document(). Firebase is returning an error

@export var userboard1 : Dictionary = {"name": "kenny", "info": [[1,2], [2,3]]}

It has to do with that subarray, because if I swap it with a dictionary or something else, then it works. image image

shafnaz commented 1 year ago

[Firebase Error] >> Invalid JSON payload received. Unknown name "arrayValue" at 'document.fields[31].value.map_value.fields[0].value.array_value.values[0]': Proto field is not repeating, cannot start list. Invalid JSON payload received. Unknown name "arrayValue" at 'document.fields[31].value.map_value.fields[0].value.array_value.values[1]': Proto field is not repeating, cannot start list.

WolfgangSenff commented 1 year ago

It looks like that's a bug in the format of your list. Try switching it to something like this and see if it works:

"info" : [{ value: [1, 2] }, { value: [2, 3] }]

I'm not sure if that'll work, but it's worth a shot. It seems to do with how Firebase represents the underlying fields, and Protobuf, the protocol that they use for data serialization I believe, is choking on your data.

shafnaz commented 1 year ago

Yes , that works

WolfgangSenff commented 1 year ago

Great! Closing this.