State Persistence in GCS resource

  • Goal: upload doc via cloud storage resource

  • Steps: everything is working except when running the upload, references to variables pull previous state

  • Details: when uploading, the previous "state" values are used. For example, if i use {{ uploadButton.value[0].name }}, hovering over the value provides the last run value (last file uploaded) or null if I've reloaded the browser (as expected). I would then assume this state to be reset when i run the queries again (triggered by upload button). However when i upload a new file the new file will have the name of the previously uploaded file, it will also pull other data i reference from the data array from the previous state.

The behavior ONLY happens after a filetype PDF has been uploaded. This behavior does not occur with other file types.

@jmann any idea on this?

Seems like it's due to the file size over the type, seeing it happen when it just takes some amount of time to serialize the file contents which scales with the size. Changing the event handler on the upload button to Parse instead of Change seems to work for me, as it only triggers the event once the file is done being serialized over it just being changed.

yep that was it! Thanks you saved me alot of hours figuring that out!