Commit c3a514e
fula-client 0.6.14: wasm/web cancellable chunked upload (mirror native cancel)
The web (non-resumable) chunked-upload path had no cancel — only the native
resumable path could abort an in-flight upload (an Arc<AtomicBool> checked
between chunk PUTs). This adds the SAME cooperative cancel to the wasm-capable
non-resumable path so the web Sync Queue can stop an in-progress large upload.
- `put_object_chunked_internal` + the shared `put_object_flat_deferred_locked`
take an optional `cancel: Option<Arc<AtomicBool>>` (the 3 existing callers
pass None — unchanged). The per-chunk `buffer_unordered` closure checks it
before the chunk PUT: a chunk not yet started short-circuits with
`ClientError::Cancelled`; chunks already in flight (<=16) finish. A second
check before the index PUT covers cancel-after-all-chunks. The existing
post-loop compensating-delete removes the uploaded (now-unreferenced) chunks
— the same cleanup as the failure path. Mirrors the native resumable cancel.
- New `pub put_object_flat_with_progress_cancellable(... progress, cancel)`.
- FRB binding `put_flat_with_progress_cancellable(&ProgressHandle, &CancelHandle)`
shares the CancelHandle's `Arc<AtomicBool>` with the upload, so triggering the
Dart-held handle sets the flag the upload polls.
NON-resumable: a cancelled upload restarts from scratch — wasm RESUMABLE
support is the next change (0.6.15). Compiles on native + wasm32 + flutter; a
unit test asserts a pre-set cancel flag aborts with `Cancelled`; the progress
and native-resumable regression tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 9ab96f3 commit c3a514e
5 files changed
Lines changed: 150 additions & 10 deletions
File tree
- crates
- fula-client
- src
- tests
- fula-flutter/src/api
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6856 | 6856 | | |
6857 | 6857 | | |
6858 | 6858 | | |
6859 | | - | |
| 6859 | + | |
6860 | 6860 | | |
6861 | 6861 | | |
6862 | 6862 | | |
| |||
6881 | 6881 | | |
6882 | 6882 | | |
6883 | 6883 | | |
6884 | | - | |
| 6884 | + | |
| 6885 | + | |
| 6886 | + | |
| 6887 | + | |
| 6888 | + | |
| 6889 | + | |
| 6890 | + | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + | |
| 6898 | + | |
| 6899 | + | |
| 6900 | + | |
| 6901 | + | |
| 6902 | + | |
| 6903 | + | |
| 6904 | + | |
| 6905 | + | |
| 6906 | + | |
| 6907 | + | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
| 6911 | + | |
| 6912 | + | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
| 6917 | + | |
6885 | 6918 | | |
6886 | 6919 | | |
6887 | 6920 | | |
| |||
6917 | 6950 | | |
6918 | 6951 | | |
6919 | 6952 | | |
6920 | | - | |
| 6953 | + | |
6921 | 6954 | | |
6922 | 6955 | | |
6923 | 6956 | | |
| |||
6935 | 6968 | | |
6936 | 6969 | | |
6937 | 6970 | | |
| 6971 | + | |
6938 | 6972 | | |
6939 | 6973 | | |
6940 | 6974 | | |
| |||
7037 | 7071 | | |
7038 | 7072 | | |
7039 | 7073 | | |
| 7074 | + | |
7040 | 7075 | | |
7041 | 7076 | | |
7042 | 7077 | | |
| |||
7277 | 7312 | | |
7278 | 7313 | | |
7279 | 7314 | | |
| 7315 | + | |
| 7316 | + | |
| 7317 | + | |
| 7318 | + | |
7280 | 7319 | | |
7281 | 7320 | | |
7282 | 7321 | | |
| |||
7338 | 7377 | | |
7339 | 7378 | | |
7340 | 7379 | | |
| 7380 | + | |
7341 | 7381 | | |
7342 | 7382 | | |
| 7383 | + | |
| 7384 | + | |
| 7385 | + | |
| 7386 | + | |
| 7387 | + | |
| 7388 | + | |
| 7389 | + | |
| 7390 | + | |
| 7391 | + | |
| 7392 | + | |
7343 | 7393 | | |
7344 | 7394 | | |
7345 | 7395 | | |
| |||
7450 | 7500 | | |
7451 | 7501 | | |
7452 | 7502 | | |
| 7503 | + | |
| 7504 | + | |
| 7505 | + | |
| 7506 | + | |
| 7507 | + | |
| 7508 | + | |
| 7509 | + | |
| 7510 | + | |
| 7511 | + | |
| 7512 | + | |
| 7513 | + | |
| 7514 | + | |
7453 | 7515 | | |
7454 | 7516 | | |
7455 | 7517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
634 | 665 | | |
635 | 666 | | |
636 | 667 | | |
| |||
0 commit comments