Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firestore not playing nice with file_uploader #4

Open
jucor opened this issue Apr 20, 2021 · 1 comment
Open

Firestore not playing nice with file_uploader #4

jucor opened this issue Apr 20, 2021 · 1 comment

Comments

@jucor
Copy link

jucor commented Apr 20, 2021

When one of the widgets is a file_uploader and Firestore is enabled, an error is thrown at stop_tracking complaining about something something not being a string something something.
(sorry, did not save the exact error anymore, I worked around it, see below).

This error does not appear when Firestore is not enabled.

I suspect this is because the return value of a file uploader is sometimes None and sometimes an instance of class UploadedFile, which is not a string. That causes a problem at seralization time into Firestore.

Workaround: I only call start_tracking() after having instanciated my file_uploader widget, meaning I cannot track any widget that comes before it. Sad, but the only way to make it work so far.

Alternative: adding a conditional to automatically convert the value of file_uploader into a string (containing maybe just the filename, not the whole uploaded file).

@jrieke
Copy link
Owner

jrieke commented Dec 29, 2021

That's weird, the return value of file uploader is actually never stored in Firestore. I can't test this right now because I don't have an instance of Firestore set up. Maybe this was also fixed with #3. If you see this again, please post the full error message, then I can give it a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants