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 crash when receiving remote change in unfocused editor #1195

Merged
merged 1 commit into from
Feb 8, 2019

Conversation

mirka
Copy link
Member

@mirka mirka commented Feb 8, 2019

This fixes an uncaught bug in #1193, where we get a WSOD when the selected note receives a remote change while the editor is unfocused.

This was caused by the same strange behavior we worked around in getCurrentBlock(), where the selectionState methods getAnchorKey() and getFocusKey() could sometimes return a ContentBlock instead of the key string.

To test

  1. Select a note, and make sure it is not focused. (Click somewhere outside the editor)
  2. In a different client, edit that same note.

→ Should not result in a WSOD

@mirka mirka force-pushed the fix/remote-change-crash branch from a09d1c4 to 9176fe9 Compare February 8, 2019 16:49
Copy link
Contributor

@roundhill roundhill left a comment

Choose a reason for hiding this comment

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

Looks good and tested well for me.

@mirka mirka merged commit f057b6e into master Feb 8, 2019
@mirka mirka deleted the fix/remote-change-crash branch February 8, 2019 18:02
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.

2 participants