Found testing v1.1.0-RC8-2-g23a2bb6 on A8 s/n 0498, over Ethernet. Related to #114 and #118, but a different path.
Repro
File upload, 300 MB file, press Cancel at ~75%.
What happens
Two red, sticky toasts:
The upload failed while writing to the USB drive. Check that it is present and has free space.
Log:
[info] Closing file
[info] Upload cancelled by the user after 0 minutes and 24 seconds
[error] Could not write a chunk of the upload to <file> after 235929600 of 314572800 bytes (75%): invalid argument
[error] Could not write a chunk of the upload to <file> after 235929600 of 314572800 bytes (75%): invalid argument
Network: the in-flight upload_chunk returns 500, then upload_cancel. get_progress ends at state: ERROR.
Why
uploadCancel closes state.File and sets it to nil while a chunk admitted by beginChunk() is still in writeChunk. The write then hits a closed/nil *os.File (invalid argument), and failChunk sets ERROR with the USB-drive message. The drain that protects against the watchdog (#118) does not apply to the cancel path.
Side effect
The state ends as ERROR, not CANCELLED, so getProgress never runs the mountUsb(MODE_RO) it does for CANCELLED. /mnt/usb stayed rw until the next options save remounted it ro.
Suggested direction
Have uploadCancel mark cancelled first, then wait for in-flight chunks (same as the watchdog) before closing the file. A write failure after the cancel should count as cancelled, not as a drive fault.
Found testing v1.1.0-RC8-2-g23a2bb6 on A8 s/n 0498, over Ethernet. Related to #114 and #118, but a different path.
Repro
File upload, 300 MB file, press Cancel at ~75%.
What happens
Two red, sticky toasts:
Log:
Network: the in-flight
upload_chunkreturns 500, thenupload_cancel.get_progressends atstate: ERROR.Why
uploadCancelclosesstate.Fileand sets it to nil while a chunk admitted bybeginChunk()is still inwriteChunk. The write then hits a closed/nil*os.File(invalid argument), andfailChunksets ERROR with the USB-drive message. The drain that protects against the watchdog (#118) does not apply to the cancel path.Side effect
The state ends as ERROR, not CANCELLED, so
getProgressnever runs themountUsb(MODE_RO)it does for CANCELLED./mnt/usbstayed rw until the next options save remounted it ro.Suggested direction
Have
uploadCancelmark cancelled first, then wait for in-flight chunks (same as the watchdog) before closing the file. A write failure after the cancel should count as cancelled, not as a drive fault.