Skip to content

Conversation

@louis-jan
Copy link
Contributor

@louis-jan louis-jan commented Sep 24, 2025

Describe Your Changes

This PR allows users to cancel a backend download.

Recording.2025-09-24.175239.mp4

This pull request introduces improvements to the download management and error handling logic for backend downloads. The main changes enhance the user experience by ensuring that download cancellations and fallback mechanisms work more reliably and intuitively.

Download cancellation logic:

  • Updated the download cancellation handler in DownloadManagement so that downloads with IDs starting with 'llamacpp' are cancelled using the @janhq/download-extension's cancelDownload method, while other downloads continue to use the existing serviceHub.models().abortDownload method. This ensures the correct cancellation mechanism is used for different types of downloads. [1] [2]

Backend download fallback and error handling:

  • Improved error handling in the downloadBackend function to prevent unnecessary fallback attempts: now, if a GitHub download fails due to cancellation (specifically, if the error message is 'Error: Download cancelled'), it will not retry the download via the CDN. This avoids redundant operations and respects user-initiated cancellations.

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 89d158c in 1 minute and 41 seconds. Click for details.
  • Reviewed 70 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_JA0L7jawLoy80ihh

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@louis-jan louis-jan force-pushed the fix/allow-users-cancel-backend-download branch from 89d158c to 1c556cd Compare September 24, 2025 10:57
@github-actions
Copy link
Contributor

Barecheck - Code coverage report

Total: 30.03%

Your code coverage diff: -0.02% ▾

Uncovered files and lines
FileLines
web-app/src/containers/DownloadManegement.tsx1, 6-15, 17-29, 31-36, 38-45, 47-48, 52-62, 64-73, 75-83, 85, 87-93, 96-104, 106-107, 109-114, 116-122, 125-130, 132-133, 135-141, 143-155, 157-170, 172-174, 177-186, 188-190, 193, 195-196, 199-207, 209-216, 218-220, 223, 225-235, 237-239, 242, 244-257, 259-270, 273-275, 277-291, 294-312, 314-317, 319-340, 342-352, 354, 356-361, 363-373, 375-383, 385-386, 388-391, 393-402, 404-408, 410-448, 450, 452

@louis-jan louis-jan merged commit 7fe58d6 into dev Sep 25, 2025
20 checks passed
@louis-jan louis-jan deleted the fix/allow-users-cancel-backend-download branch September 25, 2025 06:19
@github-project-automation github-project-automation bot moved this to QA in Jan Sep 25, 2025
@github-actions github-actions bot added this to the v0.7.0 milestone Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug: unable to cancel download on progress bar while backend is downloading

4 participants