Commit graph

14 commits

Author SHA1 Message Date
Pat Hartl
6f71d4c2e0 Fix packager LCX upload 2026-06-04 22:03:18 -05:00
Pat Hartl
4948dbc0d5 Add background uploading
Fixes #298
2026-05-28 22:26:24 -05:00
Pat Hartl
2c58c12ec6 Fix closing of upload dialog when file selected 2026-05-18 22:02:14 +00:00
akifreak
80bb5d59ee Replace var with const/let and remove unused variable in ChunkUploader
- var request and var response in Init() → const (never reassigned,
  var is function-scoped and hoisted which is undesirable in class methods)
- let formData in UploadChunk() → const (never reassigned)
- chunkResponse in UploadChunk() removed (assigned but never read)
- let start in GetChunks() → const (never reassigned)
- var percent in UpdateProgressBar() → const (never reassigned)
2026-04-04 15:05:06 +02:00
akifreak
7dbb1b7619 Remove unused UploadInitResponse import from ChunkUploader 2026-04-04 15:05:06 +02:00
akifreak
4065232e61 Null-guard progress bar DOM elements in UpdateProgressBar
document.querySelector() can return null if the elements are not
yet in the DOM. Dereferencing null would throw inside the axios
onUploadProgress callback, which is caught by UploadChunk's catch
and re-thrown as a string - causing the whole upload to fail
silently with an undefined message.
2026-04-04 15:05:06 +02:00
akifreak
9882f14d04 Fix undefined error message when UploadChunk throws a string
UploadChunk throws a template literal string, not an Error object.
Accessing .message on a string primitive returns undefined, so
JSOnUploadError was always called with undefined and the server log
showed no useful detail. Use String(ex) as fallback so the message
is always populated.
2026-04-04 15:05:06 +02:00
akifreak
a439cf5638 Propagate init net failure instead of swallowing
The original catch block was simply swalloing errors instead of
propagating them upwards.
When the /api/Upload/Init request failed it set this.Key = null, logged
to the console, and returned normally. From the caller's perspective
Init() had succeeded.

Start() in the Blazor component then called Upload() immediately after,
which proceeded with this.Key = null. Every chunk was sent to the server
with a null key, the server returned 400 for each one, each UploadChunk
call threw, and the whole upload failed - but only after sending every
chunk, and only with the opaque "Error uploading chunk N/M" message
rather than anything pointing at the actual cause.

By removing the catch, an axios error in Init() propagates up through
the JS interop call InvokeVoidAsync("Init", ...) in Start(). That throws
a JSException in C#, Start() exits immediately before Upload() is ever
called, and the finally block resets Uploading so the UI recovers. The
user gets a failure where it actually happened.
2026-04-04 15:02:46 +02:00
akifreak
910504b7df Remove leftover debugger statement from ChunkUploader.Init 2026-04-03 21:22:22 +02:00
Pat Hartl
66abc6e59e Implement infinite loading with chat thread
- Chat messages are now loaded based on scroll position
- Read status is now updated and set by last message read
- Reworked script importing by using ScriptProvider
2026-01-11 14:38:24 -06:00
Pat Hartl
8bf006b1a4 Refactor TS to classes, remove factory in place of static Create factory method, rework module importing 2026-01-07 18:25:17 -06:00
Pat Hartl
e85eeb01db Fix bundling, JS interop initialization 2026-01-03 18:26:30 -06:00
Pat Hartl
1e1fa1713d Refactor chunk uploader as JS module 2026-01-03 15:51:21 -06:00
Pat Hartl
5fefdfdef1 Move components into subfolders 2025-09-06 13:09:47 -05:00