-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SignalR as middleware for project export enhancement #817
Conversation
…e and, when ExportStatus.InProgress, receives SignalR messages
Codecov Report
@@ Coverage Diff @@
## master #817 +/- ##
==========================================
- Coverage 51.39% 51.24% -0.15%
==========================================
Files 239 241 +2
Lines 6546 6621 +75
Branches 420 424 +4
==========================================
+ Hits 3364 3393 +29
- Misses 2871 2914 +43
- Partials 311 314 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
… (need to fix dispatch)
…ntend; have backend signal when download is ready
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Backend/Startup.cs, line 94 at r4 (raw file):
Will this affect production? (e.g. non- |
Backend/Startup.cs, line 94 at r4 (raw file): Previously, jmgrady (Jim Grady) wrote…
Done |
src/components/App/SignalRHub.tsx, line 49 at r17 (raw file):
@imnasnainaec The export works when I test it, but I do see the following error logged to the console:
|
…le user (in case of front-end interruption of the first).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 29 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor and @johnthagen)
src/components/App/SignalRHub.tsx, line 49 at r17 (raw file):
Previously, johnthagen wrote…
@imnasnainaec The export works when I test it, but I do see the following error logged to the console:
index.js:1 Error: Cannot start a HubConnection that is not in the 'Disconnected' state. at HubConnection.<anonymous> (HubConnection.ts:163) at step (HubConnection.ts:2) at Object.next (HubConnection.ts:2) at HubConnection.ts:2 at new Promise (<anonymous>) at push../node_modules/@microsoft/signalr/dist/esm/HubConnection.js.__awaiter (HubConnection.ts:2) at HubConnection.startWithStateTransitions (HubConnection.ts:161) at HubConnection.start (HubConnection.ts:157) at SignalRHub.tsx:49 at commitHookEffectListMount (react-dom.development.js:19731) at commitPassiveHookEffects (react-dom.development.js:19769) at HTMLUnknownElement.callCallback (react-dom.development.js:188) at Object.invokeGuardedCallbackDev (react-dom.development.js:237) at invokeGuardedCallback (react-dom.development.js:292) at flushPassiveEffectsImpl (react-dom.development.js:22853) at unstable_runWithPriority (scheduler.development.js:653) at runWithPriority$1 (react-dom.development.js:11039) at flushPassiveEffects (react-dom.development.js:22820) at performSyncWorkOnRoot (react-dom.development.js:21737) at react-dom.development.js:11089 at unstable_runWithPriority (scheduler.development.js:653) at runWithPriority$1 (react-dom.development.js:11039) at flushSyncCallbackQueueImpl (react-dom.development.js:11084) at flushSyncCallbackQueue (react-dom.development.js:11072) at batchedUpdates$1 (react-dom.development.js:21862) at Object.notify (Subscription.js:19) at Subscription.notifyNestedSubs (Subscription.js:92) at Subscription.handleChangeWrapper (Subscription.js:97) at Object.dispatch (redux.js:222) at e (<anonymous>:1:40553) at Object.dispatch (index.js:11) at dispatch (<anonymous>:1:28545) at ExportProjectActions.tsx:31 at HubConnection.method (SignalRHub.tsx:45) at HubConnection.ts:634 at Array.forEach (<anonymous>) at HubConnection.invokeClientMethod (HubConnection.ts:634) at HubConnection.processIncomingData (HubConnection.ts:530) at WebSocketTransport.HubConnection.connection.onreceive (HubConnection.ts:102) at WebSocket.webSocket.onmessage (WebSocketTransport.ts:94) console.<computed> @ index.js:1 overrideMethod @ react_devtools_backend.js:2430 (anonymous) @ SignalRHub.tsx:49 Promise.catch (async) (anonymous) @ SignalRHub.tsx:49 commitHookEffectListMount @ react-dom.development.js:19731 commitPassiveHookEffects @ react-dom.development.js:19769 callCallback @ react-dom.development.js:188 invokeGuardedCallbackDev @ react-dom.development.js:237 invokeGuardedCallback @ react-dom.development.js:292 flushPassiveEffectsImpl @ react-dom.development.js:22853 unstable_runWithPriority @ scheduler.development.js:653 runWithPriority$1 @ react-dom.development.js:11039 flushPassiveEffects @ react-dom.development.js:22820 performSyncWorkOnRoot @ react-dom.development.js:21737 (anonymous) @ react-dom.development.js:11089 unstable_runWithPriority @ scheduler.development.js:653 runWithPriority$1 @ react-dom.development.js:11039 flushSyncCallbackQueueImpl @ react-dom.development.js:11084 flushSyncCallbackQueue @ react-dom.development.js:11072 batchedUpdates$1 @ react-dom.development.js:21862 notify @ Subscription.js:19 notifyNestedSubs @ Subscription.js:92 handleChangeWrapper @ Subscription.js:97 dispatch @ redux.js:222 e @ VM347:1 (anonymous) @ index.js:11 dispatch @ VM347:1 (anonymous) @ ExportProjectActions.tsx:31 method @ SignalRHub.tsx:45 (anonymous) @ HubConnection.ts:634 HubConnection.invokeClientMethod @ HubConnection.ts:634 HubConnection.processIncomingData @ HubConnection.ts:530 HubConnection.connection.onreceive @ HubConnection.ts:102 webSocket.onmessage @ WebSocketTransport.ts:94
I believe that's resolved now.
This pull request introduces 1 alert when merging 6f4db7f into 235c91c - view on LGTM.com new alerts:
|
Backend/Controllers/LiftController.cs, line 241 at r19 (raw file):
Better to catch(Exception e) and throw e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 29 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor and @johnthagen)
Backend/Controllers/LiftController.cs, line 241 at r19 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
Better to catch(Exception e) and throw e;
That's what I'd done at first, but LGTM said it's bad practice, breaking call-stacks, and suggested this format. I assumed this way implicitly threw the error it caught.
Backend/Controllers/LiftController.cs, line 241 at r19 (raw file): Previously, imnasnainaec (D. Ror.) wrote…
So it does...lgtm taught me something new today. |
Backend/Services/LiftApiServices.cs, line 92 at r19 (raw file):
For style purposes make this a const and move it to the top of the file. Unless LGTM doesn't like that either. ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 29 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor and @johnthagen)
Backend/Services/LiftApiServices.cs, line 92 at r19 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
private readonly string inProgress = "IN_PROGRESS";
For style purposes make this a const and move it to the top of the file. Unless LGTM doesn't like that either. ;)
Moved to top of class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 24 files at r2, 1 of 4 files at r4, 1 of 6 files at r14, 1 of 2 files at r15, 1 of 3 files at r16, 1 of 3 files at r17, 7 of 9 files at r18, 2 of 2 files at r19, 1 of 1 files at r20.
Dismissed @johnthagen from a discussion.
Reviewable status: complete! all files reviewed, all discussions resolved
src/components/ProjectExport/ExportProjectButton.tsx, line 16 at r20 (raw file):
utto
Colony collapse disorder must be affecting your code comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 11 of 24 files at r2, 1 of 4 files at r4, 2 of 2 files at r6, 2 of 4 files at r7, 1 of 6 files at r14, 1 of 2 files at r15, 1 of 3 files at r16, 1 of 3 files at r17, 5 of 9 files at r18, 2 of 2 files at r19, 1 of 1 files at r20, 1 of 1 files at r21.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r22.
Reviewable status: complete! all files reviewed, all discussions resolved
Follow-up to #819
TODO:
/hub
or, perhaps better, move/hub
to where all other backend paths areThis change is