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

Live Update: collection proxy fails to load if missing resources are loaded in wrong order #7233

Closed
aglitchman opened this issue Dec 20, 2022 · 2 comments
Labels
bug Something is not working as expected engine Issues related to the Defold engine live update Issue related to the Live Update feature

Comments

@aglitchman
Copy link
Contributor

Describe the bug (REQUIRED)
We use Live Update to load extra content in our HTML5 games. What we usually do, the steps:

  • Download .zip archive generated by Live Update.
  • Call collectionproxy.missing_resources to get the missing resources array.
  • Iterate the array and call resource.store_resource to load the missing resources one by one from the zip file.
  • Load and enable the proxy.

What's wrong? Sometimes Defold fails to load the proxy. The errors are different each time: IO_ERROR or FORMAT_ERROR, i.e. there are no specific problem.

To Reproduce (REQUIRED)
Load the missing resources by calling resource.store_resource one by one in the random order to get the error sometimes. It should be done in the way of fuzz testing, I think.

Expected behavior (REQUIRED)
If we should load the missing resources in the particular order then it should be stated in the docs and the collectionproxy.missing_resources function should return the list of the missing resources in that order.

OR

Defold should be able to load (store) resources in any order.

Defold version (REQUIRED):

  • Version: 1.4.1 and many versions before.

Platforms (REQUIRED):

  • Platforms: HTML5. I didn't test other platforms.

Workaround (OPTIONAL):
Shuffle the missing resources array to store the resources in the different order! It sounds strange but it works.

Plus, this issue is the reason why I implemented this code that cleans the Live Update cache before the start of the game. Otherwise, we were getting random errors that were hard to understand and it was impossible to make a repro case.

@aglitchman aglitchman added the bug Something is not working as expected label Dec 20, 2022
@britzl britzl added live update Issue related to the Live Update feature engine Issues related to the Defold engine labels Dec 27, 2022
@britzl
Copy link
Contributor

britzl commented Dec 27, 2022

Strange. And you're sure you are storing the correct data for each missing resource?

@aglitchman
Copy link
Contributor Author

This issue is related to the legacy LiveUpdate API. The issue was fixed in Defold 1.5.0 just because of the introduction of new API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as expected engine Issues related to the Defold engine live update Issue related to the Live Update feature
Projects
None yet
Development

No branches or pull requests

2 participants