Repository navigation
Commit e3b456c
fix(desktop): apply the review of the in-app installer download
Applies the review findings on d5bd8fe, which made the deprecation
banner download the new app's installer inside the app.
Leftover partial files
- The signal-handler exit path now aborts the download and removes its
partial file. That path ends in exit(), so the download never cleaned
up after itself.
- The running download's partial path is recorded in the app data
directory. The next launch removes exactly that path, and only while
it is still a regular file named like one of this module's partials.
No folder is searched. A normal finish, cancel or exit clears the
record.
Failure reasons and actions
- A redirect the policy refuses is "redirect-blocked". It no longer
asks the user to check their internet connection.
- A write the system refuses is "permission-denied". It no longer shows
the free-space message. On macOS the wording says where to allow
access to the Downloads folder, for a user who declined the system
prompt.
- Linux falls back to ~/Downloads when no XDG download directory is
configured.
- Failures a retry cannot fix (redirect blocked, protection mark not
written, permission denied, too large) lead with "Download in
browser", which opens the validated installer URL as 78d9bcd did.
A rejected URL leads with buzz.xyz and is never opened. "Try again"
leads only for transient failures.
- The release tag is restricted to letters, digits and ._+-/ in both
the Rust validator and resolveInstallerUrl, so no percent escape
reaches GitHub.
Window and remount
- Hiding the main window no longer cancels the download. It is
cancelled when the window is destroyed or the app exits.
- The banner's owner remounts on a community switch, an identity change
and a signer change. The download state moved out of the component
into an app-level store, so the download and its dialog survive that.
This was smaller than a visible "cancelled" state, which needs the
same store to outlive the remount and new wording on top.
Dialog
- Focus moves to Cancel when a download starts or restarts. A repeated
Enter keydown inside the dialog is ignored, so holding Enter on the
banner button or on "Try again" cannot cancel the download it started.
- A failed reveal says the folder could not be opened and points at the
path shown. It no longer claims the file was moved or deleted.
- An AppImage's finished message gives the make-it-executable step.
- The saved file's mode follows the user's umask instead of a fixed
0644: tempfile creates the partial with mode 0666 under the umask.
Tests
- The mock bridge gained "finish on next cancel" and "fail next
reveal". The smoke journeys assert the rendered result of each, plus
held Enter, focus after retry, each failure's actions, and a community
switch mid-download.
- A jsdom test drives the real hook: the attempt fence, the mount-time
cancel, and survival across unmount and remount.
Where this differs from the review decisions
- The hook's unmount cancel is removed, not tested. Surviving a remount
requires that unmounting does not cancel, so the test asserts the
opposite: unmount sends no cancel and the next mount shows the same
download. The mount-time cancel now runs only when this page has no
download of its own, and the hook's doc comment states the
single-window assumption.
- permission-denied keeps "Try again" as its secondary action. The
message tells the user how to grant access, after which the same
download works.
Windows: no behaviour changed. CI does run this crate's tests on
Windows. The required "Windows Rust (x86_64-pc-windows-msvc)" job in
_ci-rust.yml runs cargo test for desktop/src-tauri on windows-latest
when desktop/src-tauri changes, so
mark_of_the_web_write_is_verified_by_reading_it_back writes and reads a
real alternate data stream there. Not covered anywhere: the stream
surviving the final rename inside download_installer, and SmartScreen.
macOS CI only builds this crate, so the quarantine test runs locally
only. d5bd8fe is not pushed yet, so no Windows or Linux CI result
exists for this code.
Verified on macOS arm64
- Desktop: biome check, tsc, file-size check, unit tests (6970 node,
187 jsdom), production build.
- Tauri crate: fmt, clippy with and without mesh-llm, cargo test
--workspace (3470 lib tests), cargo test --features mesh-llm --lib
(3576 tests).
- Smoke: deprecation-banner.spec.ts, 6 journeys, on an e2e build.
- Falsified: 13 Rust, 15 unit and hook, and 7 smoke mutations. Each
fails the test that guards it. One gap found this way is closed: the
recovery test did not notice a followed symlink.
- Native debug build: the download was saved with the umask's mode and
com.apple.quarantine set, and Finder revealed it. Cancel removed the
partial. With the window hidden the partial kept growing, and the
dialog reopened from the tray read 29% then 35%. SIGTERM and a menu
quit mid-download removed the partial. After SIGKILL the next launch
removed the recorded partial and left a lookalike .part file beside
it. Mid-download steps ran through a local throttling proxy.
Not verified
- The macOS consent prompt and the permission-denied path in a real
app: a binary started from a terminal inherits the terminal's access.
- The new Rust tests on Windows and Linux. They run in CI after a push.
- The full desktop smoke suite. Only the banner spec ran.
The rebase of this branch onto origin/main was aborted before this
commit and still needs doing.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>1 parent d5bd8fe commit e3b456c
16 files changed
Lines changed: 1380 additions & 199 deletions
File tree
- desktop
- src-tauri/src
- commands
- src
- app
- testing
- tests/e2e
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
157 | 183 | | |
158 | 184 | | |
159 | 185 | | |
| |||
202 | 228 | | |
203 | 229 | | |
204 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
205 | 237 | | |
206 | 238 | | |
207 | 239 | | |
| |||
359 | 391 | | |
360 | 392 | | |
361 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
362 | 458 | | |
363 | 459 | | |
364 | 460 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
370 | 502 | | |
371 | 503 | | |
372 | 504 | | |
| |||
568 | 700 | | |
569 | 701 | | |
570 | 702 | | |
| 703 | + | |
| 704 | + | |
571 | 705 | | |
572 | 706 | | |
| 707 | + | |
573 | 708 | | |
574 | 709 | | |
575 | 710 | | |
| 711 | + | |
| 712 | + | |
576 | 713 | | |
577 | 714 | | |
578 | 715 | | |
579 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
580 | 799 | | |
581 | 800 | | |
582 | 801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
934 | 935 | | |
935 | 936 | | |
936 | 937 | | |
| 938 | + | |
937 | 939 | | |
938 | | - | |
939 | | - | |
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
63 | | - | |
64 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
0 commit comments