fix: upload double-submit, DB race, and add real progress tracking#1537
Open
kuu-26 wants to merge 2 commits intoValour-Software:mainfrom
Open
fix: upload double-submit, DB race, and add real progress tracking#1537kuu-26 wants to merge 2 commits intoValour-Software:mainfrom
kuu-26 wants to merge 2 commits intoValour-Software:mainfrom
Conversation
- JS: uploadWithProgress() uses XMLHttpRequest with upload.onprogress for real-time progress tracking - JS: abortCurrentUpload() allows cancelling in-progress uploads - FileUploadComponent: shows progress bar with % and bytes during upload - FileUploadComponent: cancel button during upload, error display on failure - FileUploadComponent: new ModalParams with UploadUrl, AuthToken, OnUploadSuccess - InputComponent: passes upload URL and auth token so modal can do the upload itself - CSS: progress bar with gradient, error state styling, danger button for cancel
- UploadService.cs: scoped DI service with UploadAsync(), CancelCurrent() - real wire-level progress via XHR (not fake C# stream copying) - CancellationToken support for clean cancellation - UploadProgressInfo record with Percent, FormattedUploaded, FormattedTotal - UploadResult record with Success/Response/Error - IAsyncDisposable, lazy-loads JS module on first use - UploadService.js: ES module following ResizeObserver pattern, no more globals - FileUploadComponent: now uses UploadService instead of raw JS interop - deleted all the [JSInvokable] callbacks from the component - progress display uses UploadProgressInfo formatting - cancel via CancellationTokenSource instead of calling JS directly - removed uploadWithProgress/abortCurrentUpload from main.js - registered UploadService in DI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three related fixes for the upload flow, all in one branch since they stack on each other:
1. Prevent double-submit on upload + handle DB race on CDN insert (
8895354)2. Add upload progress bar and cancel support (
c5d1084)uploadWithProgressJS function so the modal actually shows real progressabortCurrentUpload()3. Wrap upload JS interop in reusable UploadService (
1577f8f)[JSInvokable]callbacks out of FileUploadComponent into a proper scoped DI serviceUploadAsync()with CancellationToken support,UploadProgressInfoandUploadResultrecordswindow._currentUploadAbort), follows the ResizeObserver pattern already used in the projectTested: builds clean on Client.csproj