Skip to content
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

fix(app): Remove Electron RPC remote objects from Redux state #3820

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

mcous
Copy link
Contributor

@mcous mcous commented Aug 5, 2019

overview

Ticket and fix

Some of the remote calls from the app to the shell were leaking Electron RPC (not to be confused with our Robot RPC API) 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, which in the worst case could white-screen the UI. This commit removes unnecessary remote calls and ensure returned objects are cloned into plain-old JS objects.

changelog

  • fix(app): Remove Electron RPC remote objects from Redux state

review requests

  • discovery substate is still populated correctly at launch
  • config substate is still populated correctly at launch
  • IPC dispatch channel (to send actions back and forth from the UI to the main process) still works
    • e.g. discovery and config actions

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.
@mcous mcous added bug app Affects the `app` project ready for review fix PR fixes a bug labels Aug 5, 2019
@mcous mcous requested a review from a team August 5, 2019 16:40
Copy link
Contributor

@Kadee80 Kadee80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌐

  • discovery substate is still populated correctly at launch (for both balena and buildroot robots)
  • config substate is still populated correctly at launch
  • IPC dispatch channel still works

@mcous mcous merged commit d5f3fe3 into edge Aug 6, 2019
@mcous mcous deleted the app_remote-objects-cleanup branch August 6, 2019 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Affects the `app` project bug fix PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants