-
Notifications
You must be signed in to change notification settings - Fork 316
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
Storage.getFile() not returning files from GAIA #1616
Comments
Oh, I see. This might be a cacheing issue or similar. Ideally, we could pass a flag to bust-cache -- would that work? Will check with devops |
That might be helpful, would need to test it out though. |
@janniks any update on this? |
There might be an escape hatch to easily do this on the current setup. Could you test if the following makes a difference for your case? We'll use a global fetch-options object to configure the network call that's being made by the storage methods. import { getFetchOptions } from '@stacks/network';
const fetchOpts = getFetchOptions();
fetchOpts.headers['Cache-Control'] = 'no-cache'; Run this somewhere before your storage call and it should make the request not-cache the result. Should work with any of the cache-control headers https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control lmk if this works 🙏 if not please re-open |
I tried updating fetch-options using the following code:
On running this code, I got the following error: Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'Cache-Control') I also tried updating fetch-options using setFetchOptions functions:
Running this code results in a CORS error. Let me know if I'm missing something. Thanks. |
@bilal-waheed is working on this from our end. And the above mentioned did not work. |
What version of Stacks.js are you using?
Describe the bug
Unable to read a file stored on Gaia from after it has been put there successfully.
how to reproduce
Use the following piece of code:
However by simply omitting the first getFile call this gets resolved:
Expected behavior
Both pieces of code should return the file after it has been written successfully.
Additional context
This is just an example to illustrate a piece of code in an application that checks whether a file exists (and returns its contents) on GAIA before creating it.
The text was updated successfully, but these errors were encountered: