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

Release notes bug #1679

Merged
merged 4 commits into from
May 24, 2021
Merged

Release notes bug #1679

merged 4 commits into from
May 24, 2021

Conversation

jameskerr
Copy link
Member

@jameskerr jameskerr commented May 24, 2021

Fixes #1677

An ipc call mistakenly made its way into the Launches reducer. The
reducer is run in both the main and the renderer process, because
it is global. When the ipc was called on the main process, there
was an error.

The error was being thrown in the console:

Error occurred in handler for 'globalStore:dispatch': TypeError: Cannot read property 'app' of undefined

This caused the "last-launched" state to never be saved.

An ipc call mistakenly made its way into the Launches reducer. The
reducer is run in both the main and the renderer process, because
it is global. When the ipc was called on the main process, there
was an error.

It would be good to also find a way to surface these errors more.
@jameskerr jameskerr requested a review from mattnibs May 24, 2021 20:13
@@ -10,9 +10,8 @@ const slice = createSlice({
name: "$Launches",
initialState: {},
reducers: {
touchVersion: (state, action: PayloadAction<string | undefined>) => {
let key = action.payload || getVersion()
Copy link
Member Author

Choose a reason for hiding this comment

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

This getVersion() call was what was causing the error. It makes a sync ipc call to the 'main' process. But this code was being run in the "main" process.

@jameskerr jameskerr merged commit 58c5ba0 into main May 24, 2021
@jameskerr jameskerr deleted the release-notes-bug branch May 24, 2021 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redundant Release Notes tabs keep opening on Brim relaunch
2 participants