-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app): Remove Electron RPC remote objects from Redux state (#3820)
Some of the remote calls from the app to the shell were leaking Electron RPC remote objects into the Redux state. If the main process does anything weird to these remote objects, the Redux state might be mutated under our feet. This commit removes unnecessary remote calls and ensure returned objects are cloned into plain-old JS objects.
- Loading branch information
Showing
16 changed files
with
252 additions
and
239 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// @flow | ||
import type { LogLevel } from '../logger' | ||
|
||
export type UrlProtocol = 'file:' | 'http:' | ||
|
||
export type UpdateChannel = 'latest' | 'beta' | 'alpha' | ||
|
||
export type DiscoveryCandidates = string | Array<string> | ||
|
||
export type Config = { | ||
devtools: boolean, | ||
|
||
// app update config | ||
update: { | ||
channel: UpdateChannel, | ||
}, | ||
|
||
// robot update config | ||
buildroot: { | ||
manifestUrl: string, | ||
}, | ||
|
||
// logging config | ||
log: { | ||
level: { | ||
file: LogLevel, | ||
console: LogLevel, | ||
}, | ||
}, | ||
|
||
// ui and browser config | ||
ui: { | ||
width: number, | ||
height: number, | ||
url: { | ||
protocol: UrlProtocol, | ||
path: string, | ||
}, | ||
webPreferences: { | ||
webSecurity: boolean, | ||
}, | ||
}, | ||
|
||
analytics: { | ||
appId: string, | ||
optedIn: boolean, | ||
seenOptIn: boolean, | ||
}, | ||
|
||
// deprecated; remove with first migration | ||
p10WarningSeen: { | ||
[id: string]: ?boolean, | ||
}, | ||
|
||
support: { | ||
userId: string, | ||
createdAt: number, | ||
name: string, | ||
email: ?string, | ||
}, | ||
|
||
discovery: { | ||
candidates: DiscoveryCandidates, | ||
}, | ||
|
||
// internal development flags | ||
devInternal?: { | ||
allPipetteConfig?: boolean, | ||
tempdeckControls?: boolean, | ||
enableThermocycler?: boolean, | ||
enablePipettePlus?: boolean, | ||
enableBuildRoot?: boolean, | ||
}, | ||
} | ||
|
||
export type UpdateConfigAction = {| | ||
type: 'config:UPDATE', | ||
payload: {| | ||
path: string, | ||
value: any, | ||
|}, | ||
meta: {| | ||
shell: true, | ||
|}, | ||
|} | ||
|
||
export type SetConfigAction = {| | ||
type: 'config:SET', | ||
payload: {| | ||
path: string, | ||
value: any, | ||
|}, | ||
|} | ||
|
||
export type ConfigAction = UpdateConfigAction | SetConfigAction |
This file contains 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 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 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 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 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
Oops, something went wrong.