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

Refactor: Use direct comparison of note id when receiving remote upates #1838

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Jan 16, 2020

In onNoteBeforeRemoteUpdate we give ourselves a chance to rebase local edits
on a note before remote changes are applied. Although we haven't identified any
problem related to this refactor, we have been using indirect measures to check
if the note we are working with is the note we think it is. That is, we were
checking against selectedNoteId as a proxy for note.id when relying on
note.id works and eliminates the possibility that selectedNoteId doesn't
match note.id

In this patch we're simplifying to rely solely on that direct measure and
eliminting one possible bug.

Testing

Since I'm not sure that this has been causing any issues I don't know how to test it.
Please smoke-test the app.

Verify that remote updates correctly "rebase" local changes when they come in.
You'll need to sequence a change on another device to occur before local changes
flush and send their updates to the server.

@dmsnell dmsnell requested a review from a team January 16, 2020 04:48
Copy link
Member

@codebykat codebykat left a comment

Choose a reason for hiding this comment

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

Smoke-tested, seems fine 👍

@dmsnell dmsnell force-pushed the refactor/remove-split-data branch from e5577de to e2a5f9e Compare January 16, 2020 21:55
In `onNoteBeforeRemoteUpdate` we give ourselves a chance to rebase local edits
on a note before remote changes are applied. Although we haven't identified any
problem related to this refactor, we have been using indirect measures to check
if the note we are working with is the note we think it is. That is, we were
checking against `selectedNoteId` as a proxy for `note.id` when relying on
`note.id` works and eliminates the possibility that `selectedNoteId` doesn't
match `note.id`

In this patch we're simplifying to rely solely on that direct measure and
eliminting one possible bug.
@dmsnell dmsnell force-pushed the refactor/remove-split-data branch from e2a5f9e to 3f00a95 Compare January 17, 2020 01:24
@dmsnell dmsnell merged commit dee5093 into develop Jan 17, 2020
@dmsnell dmsnell deleted the refactor/remove-split-data branch January 17, 2020 01:50
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