-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Initial WebSocket support #5043
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
Merged
Merged
Conversation
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
jackkav
reviewed
Aug 15, 2022
packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx
Outdated
Show resolved
Hide resolved
c45ebf9
to
4f63cda
Compare
* wip * add fail safe Co-authored-by: Mark Kim <[email protected]>
* add url to ws-request model * fix webSocketRequest typo and add url * add websocket api and expose it through preload ipc * add typings Co-authored-by: Mark Kim <[email protected]>
Co-authored-by: Dimitri Mitropoulos <[email protected]>
* add initial changes for websocket message * add abstraction for db operation and websocket operation * remove console * add rename * add basic testing * add basic testing * add unit tests * add form event type * add comments * disallow exporting context directly * add suggested changes * refresh the query * using useDeepCompareEffect * rename variable * add mock * clean up * clean up * correct the file name * add some changes * removing nedb-context and its hooks * remove database changes for event sending
* first ui pass * extract and wire up bulk editor * raise ready state, move send * add upgrade header debug logs * can pass header to websocket upgrade * implement readOnly headers * add upgrade event and sent headers * clean up * fill out http upgrade into the event * change upgrade message * read only headers while connected * remove upgrade event * revert bulk editor change * fix header editable toggle * add nunjucks todos * improve readOnly implementation * disable codemirror/nunjucks for websocket headers * take calculated headers out of the data model * move hardcoded default headers down the tree * fix request url rendering issue * removed spammy warning * clarify prop name * refine pair typing * change placeholder * remove readOnly header property * fix readOnly header layout
…t-actions-dropdown.tsx
* first pass as event * add handshake ui * add timeline tab * simplify ResponseTimelineViewer * transform res debug modal to change timeline props * decouple timeline fetching from timeline component * timeline ui pass * record headers in request and response models * can view timeline history * write timeline to file * some timeline * can persist event logs * put interface beside usage * add note * add event log history * remove table event row * tidying up * make ws colors match * enable multiple open connections * close open connections at app exit * remove old test * Update packages/insomnia/src/models/request-version.ts * fix type * default readystate * fix preview css scroll Co-authored-by: James Gatz <[email protected]>
* remove unused context provider * show errors in event tab * updates timeline with message and close * clean up * show errors in timeline * fix WebSocket capitalisation * make timeline reader specific to ws * write outbound messages to the timeline * fix type
* close ws connection when response is changed * add delete logic for the queue mapg * set error response to active response * useRef for CodeEditor * extract closeRequest * use requestId to eliminate inconsistencies * refactor extract clean up methods * timeline feedback * change type annotation * fix type * Revert "use requestId to eliminate inconsistencies" This reverts commit 98335a9. Co-authored-by: Mark Kim <[email protected]>
* add minimal change to the auth flow * add disable state * adding dropdown disable * simplify reducer * fix lint Co-authored-by: jackkav <[email protected]>
…ction (#5120) * add auth to the header * remove console log * remove unneeded async * add success redirect logic to websocket server * add unexpected-response handler Co-authored-by: jackkav <[email protected]>
* make consistent with main bridge * rename webSocket * remove deviated mock * use consistent arrow function defintions * Update packages/insomnia/src/main/network/websocket.ts Co-authored-by: James Gatz <[email protected]> Co-authored-by: James Gatz <[email protected]>
* Reverse the event log order in the view and subscribe to messages after the latest
* init websocket-response model * add websocket response model * remove unused timeline getter * remove unused functionality from the ws-response model
* add empty state * use the empty state pane Co-authored-by: gatzjames <[email protected]>
* just poll * remove cts and eventlog channel
* remove unused names * fix copypasta icon * ensure all subcompnent drop state on request change * move empty state to response pane
filfreire
approved these changes
Sep 9, 2022
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.
jackkav
approved these changes
Sep 9, 2022
marckong
reviewed
Sep 13, 2022
environmentId, | ||
}) => { | ||
const editorRef = useRef<UnconnectedCodeEditor>(null); | ||
useEffect(() => { | ||
let isMounted = true; |
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.
I wonder what was the reason for this check for isMounted?
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.
Decision to make before merge:
Nitpicks
naming decision notes:
two words "WebSocket", "web-socket", "web_socket", "webSocket"one word, with an abbreviation exception "WebSocket", "websocket", "WS"