GodotFirebase icon indicating copy to clipboard operation
GodotFirebase copied to clipboard

[BUG] nextPageToken is returned as a String only. No key & string return.

Open shafnaz opened this issue 4 years ago • 5 comments

Describe the bug nextPageValue only returns a string

To Reproduce

func query_collection_list():
	var add_task : FirestoreTask = Firebase.Firestore.list(firestore_collection_id, 3)
	var task_result = yield(add_task, "task_finished")
	print("result: ", task_result[task_result.size() - 1])

returns:

AFTOeJwenuu5TLABMMWVpskruVa0RHYxt6D-WUKOhvsVD3-iXCduHUOoOAqooiM5wbpR-c3WLGp91JT3wRCb1OaGaZecfhTT9eI8YB-TcV--ypzM4UJDbZmG_0

This only returns a string

Expected behavior returns:

next_page_token: AFTOeJwenuu5TLABMMWVpskruVa0RHYxt6D-WUKOhvsVD3-iXCduHUOoOAqooiM5wbpR-c3WLGp91JT3wRCb1OaGaZecfhTT9eI8YB-TcV--ypzM4UJDbZmG_0

Screenshots image

Environment:

  • Windows 10

shafnaz avatar Oct 24 '21 11:10 shafnaz

You're printing the task[size - 1] result that returns? I don't even know what that would print - possibly the headers? Why are you trying to print such a thing? I am 99% certain this is not a bug in our code, but some weird thing you're trying to print and not printing correctly. What exactly are you trying to print?

WolfgangSenff avatar Oct 24 '21 17:10 WolfgangSenff

Well, I want to get the token to the next page. I expected it would have a key called next_page_token, just like you have other key names like doc_fields, create_time, doc_name. If I want to get that token, i use task_result[task_result.size() - 1]. So then when I click to get the next page, I use that token. Is there a better way to do it?

shafnaz avatar Oct 25 '21 12:10 shafnaz

I sincerely doubt that's the syntax you're wanting to use. I would recommend printing the task_result out, and/or all the keys it contains, and referencing it by key instead of attempting to index into a Godot object, which has unpredictable results at best. If you know it's called next_page_token, then do this: task_result["next_page_token"]

WolfgangSenff avatar Oct 25 '21 12:10 WolfgangSenff

Sorry, I don't understand. I'm trying to find a clear indicator that there is a next page token in the data returned. I use this method:

func list(path : String = "", page_size : int = 0, page_token : String = "", order_by : String = "") -> FirestoreTask

The last data appended is the nextPageToken, but it's just appended as a string. and I have to assume it's the token, whereas the other info in the data is listed as: doc_name: ... doc_fields: ... create_time: ...

Shouldn't there be something like this as well: next_page_token: ... or nextPageToken: ... Just for consistency. Or am I looking at it differently? image

shafnaz avatar Oct 25 '21 13:10 shafnaz

@shafnaz Can you make a minimal project to demonstrate this, or share some more details. I have some time coming up where I might be able to look at it.

Thanks

Chuck

BearDooks avatar Nov 26 '21 20:11 BearDooks

Closing for now as we haven't heard back for about a year.

WolfgangSenff avatar Oct 05 '22 21:10 WolfgangSenff