Repository navigation
Frontend realtime: upload progress, Socket.IO status, remove unused components - #1719
Merged
mftee merged 1 commit intoNov 20, 2026
Conversation
Contributor
|
@BigBen-7 is attempting to deploy a commit to the Mftee's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@bobaivigitalpoint-ui Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #1641
Closes #1642
Closes #1643
Closes #1644
Changes
frontend/lib/upload-xhr.ts(uploadWithProgress: XHR withupload.onprogress, cookie credentials plus bearer token, percentage capped at 99 until the server answers,abort()).documents/upload/page.tsxnow drives the progress bar from bytes sent (withrole="progressbar") and its Cancel button aborts an in-flight upload. The fakesetIntervalprogress is gone. The oldsrc/lib/upload-progress.tstracker and the unusedDropZonewere deleted (the page keeps its own keyboard-accessible drop area). Tests:lib/__tests__/upload-xhr.test.ts.documents/[id]/verify/page.tsx: the rawWebSocketto a non-existent path, fake progress and single 8-second poll are replaced by the Socket.IO hook (listens forverification:status-changed) plus polling with exponential backoff (2s, 4s, ... capped at 30s, 12 attempts) as the fallback; progress is indeterminate, with a "still processing" message when polling gives up (newdocumentVerify.stillProcessingin en/fr/es).hooks/useDocumentStatusSocket.ts(moved fromsrc/hooks/, rewritten): connects to the/documentsnamespace with cookie auth, emitssubscribe:documenton connect, forwardsdocument:status-changedandverification:status-changed, unsubscribes and disconnects on unmount.documents/[id]/page.tsxuses it (status updates immediately and data, including risk, is refetched); its own raw WebSocket reconnect loop was removed.socket.io-clientadded topackage.json.components/documents/{DocumentHeader,DocumentMetadata,EmptyAnalysisState,ReportLinkCard,RiskSummary,StatusTimeline,VerificationNotice,VerifyOnStellarButton}.tsx,components/ui/ReferenceCard.tsx(and its test), andhooks/useDocument.ts,hooks/useVerifyDocument.ts.RiskGaugeis not deleted:ParcelSidebarand a test import it.Not done / caveats
package-lock.jsonwas not updated for the newsocket.io-clientdependency (nothing was installed), sonpm ciwill fail until the lockfile is regenerated.verified), so the page upper-cases them to its status type.request()does (a 401 shows the generic failure message).knip/ts-pruneCI step was added (it needs a new dev dependency and lockfile change).frontend/src/is also being removed anduseDocumentStatusSocketmoved in the Tarrii PR; expect a conflict on those files.Not verified
cargo build/test/fmt/clippy, nonpm install/test/lint, no workflow run. The only check performed was a syntax-level read of the files I touched. Please let CI be the first real run.