Closed
Description
[REQUIRED] Describe your environment
- Operating System version: mac os 11.6.8
- Browser version: chrome 108.0.5359.98
- Firebase SDK version: 9.15.0
- Firebase Product: storage
[REQUIRED] Describe the problem
i'm using an upstream package called reactfire to use this lib with hooks etc for react. I'm trying to debug an issue where the downloadToken
for an image is not correct when using the useStorageDownloadURL hook. This appears to ultimately call into the firebase-js-sdk and the ref's getDownloadURL method. This then calls into another getDownloadURL in storage. Then downloadURLHelper get's involved and finally downloadUrlFromResourceString constructs the url.
What i'm finding is that getDownloadUrl is not using the correct token. It's like it gets cached or it's not getting set properly.
As you can see here
The token used from downloadTokens in the request is quite different from what was returned from the server.
Steps to reproduce:
- Upload an image.
- Request the images url to show it on the web
- Delete the image
- Upload a new image to the same storage location
- Request the images url to show it on the web
- Request fails with a 403 since the wrong access token was used
Relevant Code:
// I can provide code but it's a few levels away from the source...