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

[Offline] What happens when storage.store is called twice with the same manifestURI as input ? #6338

Closed
loicraux opened this issue Mar 11, 2024 · 5 comments · Fixed by #6431
Assignees
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: docs Improvements or fixes to documentation
Milestone

Comments

@loicraux
Copy link
Contributor

Have you read the Tutorials?
Yes

Have you read the FAQ and checked for duplicate open issues?
Yes

If the question is related to FairPlay, have you read the tutorial?
N/A

What version of Shaka Player are you using?
Latest version 4.7.11

What browser and OS are you using?
Chrome browser
Windows, MacOS & Linux systems

Please ask your question
What happens if the storage.store API is called twice with the same manifestUri input parameter ?
For instance like this :

const storedContent1 = await storage.store(manifestURI).promise;
const storedContent2 = await storage.store(manifestURI).promise;
console.log(storedContent1.offlineUri === storedContent2.offlineUri); // Is this true or false ?
  • Is the content downloaded twice and we get two different offlineURIs ?
  • Is the content downloaded only once but we get two different offlineURIs ?
  • Is the content downloaded only once and we get the same offlineURIs ?

Thanks in advance for your answer !

@loicraux loicraux added the type: question A question from the community label Mar 11, 2024
@joeyparrish
Copy link
Member

Looks like a short enough code snippet to just run it and find out. 😄

I believe this would download the content twice, and give you two different offline URIs. But you can try it and confirm if you like.

@loicraux
Copy link
Contributor Author

loicraux commented Mar 12, 2024

Yes, I admit I was a bit lazy on that one... 🤣 I thought that someone who worked on the offline storage code could have given me a quick straight answer...

After inspecting the shaka player code, I can confirm that if you download the same manifestUri twice using the storage.store API, the content is downloaded twice and you get in return two different offlineUri, which seems to me to be the right behavior...

Do you think this should be added to the documentation ?

@joeyparrish
Copy link
Member

I would be happy to review docs PRs.

The way I tend to think about this is, "if I couldn't tell, maybe we should add a note somewhere". It's similar to me to the other thing I try to remember, which is, "if my code reviewer had to ask how this works, I should add a code comment".

So, yes, please add a note to the docs that would have saved you the trouble of filing this issue!

@loicraux
Copy link
Contributor Author

Do I have to file a new issue of type "bug" or is this one (of type "question") is OK for a PR ?

@joeyparrish
Copy link
Member

No, we don't have to have a bug for every PR. But you should tag this issue in the PR, with either "Closes #6338" to close this question when the PR lands, or "Issue #6338" to reference it without closing it.

We are also happy to relabel this as a docs issue... which I'm going to do now.

@joeyparrish joeyparrish added flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this type: docs Improvements or fixes to documentation priority: P3 Useful but not urgent and removed type: question A question from the community labels Mar 13, 2024
@shaka-bot shaka-bot added this to the Backlog milestone Mar 13, 2024
@avelad avelad assigned avelad and unassigned loicraux Apr 10, 2024
@avelad avelad removed the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Apr 10, 2024
@avelad avelad modified the milestones: Backlog, v5.0 Apr 10, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jun 10, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: docs Improvements or fixes to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants