samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
185 stars 124 forks source link

chunk upload bug fix #6952

Closed ShanaLMoore closed 3 weeks ago

ShanaLMoore commented 3 weeks ago

Issues have been spotted after deploying the chunked upload work.

Sometimes the UV won't load the file and the downloaded file is corrupt. It is because it's trying to present the last chunk instead of the fully reassembled file.

github-actions[bot] commented 3 weeks ago

Test Results

    17 files  ±0      17 suites  ±0   2h 16m 9s ⏱️ - 1m 31s  6 718 tests +1   6 421 ✅ +1  297 💤 ±0  0 ❌ ±0  13 206 runs  +2  12 810 ✅ +2  396 💤 ±0  0 ❌ ±0 

Results for commit 6fec71dd. ± Comparison against base commit a8ae9539.

This pull request removes 274 and adds 275 tests. Note that renamed tests count towards both. ``` spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: fbce70ad-6a49-4e8d-b673-d23238fe5a02 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 942a61e8-4a2a-4094-8fb9-659447408952 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 336e86e3-7ed5-47fc-bddb-a95a41d84c55 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 945b3161-72c1-4ca7-874f-54a87ce907db spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 01cea523-4b49-4c9d-afbe-f4ac70ec871a spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 4fa5fe66-e99a-488d-85e9-edad73b6e48b … ``` ``` spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 63d3a33a-3c1d-486e-a033-a568ab6e0f47 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: aba9858e-3fe3-4f56-928b-d25980f69268 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 77968c4d-a944-4d29-8442-8f43864b4ded spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: a6de10ac-e248-4d8e-951b-24e989f862b4 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 9c5c78ef-dd0a-4c04-9b7e-1767f73133b0 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 35b1e8b4-0729-447f-a056-9290f57ad3d1 … ```

:recycle: This comment has been updated with latest results.

dlpierce commented 3 weeks ago

I'll mention here that we ran into a flaky feature spec that stemmed from the chunked upload changes in #6931. It's fixed in #6950. That spec uploads a file but didn't do anything with it afterwards, only checking a couple other things on the page. My theory is the async upload JS would start, but not finish before the spec finished and started cleaning up the DB, causing the User or UploadedFile lookups to fail. Something to lookout for in other specs.

ShanaLMoore commented 3 weeks ago

Ohh, thanks so much for catching and fixing it @dlpierce I'll lookout for any more.