-
Notifications
You must be signed in to change notification settings - Fork 894
feat: Auto select workspace proxy based on lowest latency #7515
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
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
159538c
WIP: Proxy auto select and user selection state
Emyrk 1305931
chore: Auto select based on latency
Emyrk d1c9f3f
Add extra test for unknown latencies
Emyrk c739f24
Move arg inside the funcs
Emyrk ae26777
Fmt
Emyrk 523e492
Duplicate import
Emyrk 877c0c9
PR feedback
Emyrk 8d26643
Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_la…
Emyrk 5c534fa
Refactor
Emyrk a3703e1
Fix useEffect dep
Emyrk c210e8d
Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_la…
Emyrk a358258
Fix deps comment
Emyrk ec860c3
Remove comment
Emyrk 3197eb1
Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_la…
Emyrk ebb6a76
Mock the hook with a hook
Emyrk 549093e
Remove unused dep
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fmt
- Loading branch information
commit ae2677736518a83e7f8b590dfd387a19f355e23b
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
export const localStorageMock = () => { | ||
const store = {} as Record<string, string>; | ||
const store = {} as Record<string, string> | ||
|
||
return { | ||
getItem: (key: string):string =>{ | ||
return store[key]; | ||
getItem: (key: string): string => { | ||
return store[key] | ||
}, | ||
setItem: (key:string, value:string)=> { | ||
store[key] = value; | ||
setItem: (key: string, value: string) => { | ||
store[key] = value | ||
}, | ||
clear: ()=> { | ||
clear: () => { | ||
Object.keys(store).forEach((key) => { | ||
delete store[key]; | ||
}); | ||
delete store[key] | ||
}) | ||
}, | ||
removeItem: (key: string) => { | ||
delete store[key] | ||
}, | ||
removeItem: (key:string) => { | ||
delete store[key]; | ||
} | ||
} | ||
} | ||
|
||
Object.defineProperty(window, "localStorage", { value: localStorageMock() }); | ||
Object.defineProperty(window, "localStorage", { value: localStorageMock() }) | ||
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.
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.
Since this is being executed when the module is imported, maybe can be interesting to move all this code into the test setup file and mock it globally. We are doing that for a few default window interfaces.
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.
maybe, I just wanted to avoid putting things in the global if my test was the only one using it atm.