Skip to content

Multiple ways to upload cracker binary - #829

Merged
four-random-common-words merged 6 commits into
masterfrom
886-cracker-binary-upload
Oct 22, 2026
Merged

four-random-common-words merged 6 commits into
masterfrom
886-cracker-binary-upload

Conversation

@four-random-common-words

@four-random-common-words four-random-common-words commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Issue: hashtopolis/server#886
Backend: hashtopolis/server#2499, hashtopolis/server#2500

Replaces the cracker version form with one that offers three ways to provide the binary:

  • uploading an archive (with progress)
  • letting the server download it from a URL
  • importing an archive already present on the server

Cracker versions now belong to an access group, so the form asks for one, and New Task and Apply Hashlist only offer versions the user can access. On New Task the cracker selection moves directly under the hashlist. GlobalService gains a generic blob download, and the backend pin and generated API types are updated to the cracker access group stack.

@four-random-common-words
four-random-common-words added this pull request to stack #831 September 29, 2026 11:16
@four-random-common-words four-random-common-words changed the title 886 cracker binary upload Multiple ways to upload cracker binary Sep 29, 2026
@four-random-common-words
four-random-common-words marked this pull request as ready for review October 19, 2026 08:39
@four-random-common-words
four-random-common-words requested review from jessevz and novasam23 and removed request for jessevz October 20, 2026 08:26
@novasam23

Copy link
Copy Markdown
Contributor

Only two minor issues: If I add a new binary version via the upload method and then happen to navigate away from the "New Cracker Version" page mid-upload, the frontend still tries to create a new binary version via a POST.

This is because the takeUntilDestroyed doesn't just unsubscribe when the page is destroyed, it completes, which then triggers resolve and eventually submitCreate() with an incomplete upload.

That then results in a notification because the incomplete upload of the binary is not in the import directory (it probably is still in the temp folder of the tus upload at this point):

Failed to create cracker version: Failed to store the archive: Source file in import directory does not exist! The uploaded archive remains in the server import directory.

This also ties into the second issue, which is that UploadTUSService.uploadFile returns an Observable with no teardown, it never calls upload.abort(). So what also happen if a user navigates away mid-upload is, that the upload still continues in the background.

The test below somehow did not catch this:

it('does not create the version when the page is left during the upload', () => {

The effects of these bugs are pretty minor because a cracker binary is only a few MBs and probably uploaded within an instant in most cases.

@four-random-common-words

Copy link
Copy Markdown
Contributor Author

The test below somehow did not catch this:

Thanks for the feedback 👍 The test was flawed because it did not await component.onSubmit
I will fix the test and the component. For the service, I think I would like to takle these problems in a separate PR, as other forms depend on it as well.

@four-random-common-words
four-random-common-words merged commit 303ad18 into master Oct 22, 2026
5 checks passed
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.

2 participants