Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented May 12, 2023

Because we were not passing byteArray to the onload handle, no data was actually getting written to the fileystem in FS_createPreloadedFile -> processData -> finish and these preloaded files were being written as empty files.

This matches the behavior of the other two plugins we have for images and audio.

Fixing this bug allows us to fix one of the issues with test_preload_module, which is that it was falling back to loading from the a URL if the file was not found. By preloading the file under a different name we prevent the URL fallback from working. The URL fallback had been silently masking the FS_createPreloadedFile issue.

Because we were not passing `byteArray` to the onload handle, no data
was actually getting written to the fileystem in FS_createPreloadedFile
-> processData -> finish and these preloaded files were being written as
empty files.

This matches the behavior of the other two plugins we have for images
and audio.

Fixing this bug allows us to fix one of the issues with
`test_preload_module`, which is that it was falling back to loading from
the a URL if the file was not found.  By preloading the file under a
different name we prevent the URL fallback from working.  The URL
fallback had been silently masking the `FS_createPreloadedFile` issue.
@sbc100 sbc100 requested a review from kripken May 12, 2023 01:15
@kripken
Copy link
Member

kripken commented May 12, 2023

Good find!

@sbc100 sbc100 merged commit 6ab4f3a into main May 12, 2023
@sbc100 sbc100 deleted the preload_wasm branch May 12, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants