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

Ensure that selected note is updated on launch when there are multiple updates #1093

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

mirka
Copy link
Member

@mirka mirka commented Dec 12, 2018

This fixes a syncing bug I found while looking into #825.

Steps to reproduce

  1. After make dev, log in to the same account in both Electron and in a browser.
  2. Pin a note to the top of the list.
  3. Close the browser tab.
  4. In Electron, make a change to the first line of the pinned note.
  5. Make a change to the second note in the list.
  6. Open the app in a browser tab.

The pinned note title is updated in the note list, but not in the editor.

Cause

This bug was introduced with the importer feature, where we started to debounce the noteUpdated action for performance reasons. This could then prevent the currently selected note from updating in the editor, if the update event was one of the calls dropped by the debounce.

Fix

Separate out the loadNotes call from the onNoteUpdate function, and only debounce the loadNotes call (contained in onNotesIndex).

@mirka mirka requested a review from roundhill December 12, 2018 15:16
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.

:shipit:

@mirka mirka merged commit ce52fb7 into master Dec 13, 2018
@mirka mirka deleted the fix/selected-note-sync branch December 13, 2018 12:55
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