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

Simperium update 0.3.2 #905

Merged
merged 3 commits into from Oct 16, 2018
Merged

Simperium update 0.3.2 #905

merged 3 commits into from Oct 16, 2018

Conversation

acrosman
Copy link
Contributor

For #827
Update to package and lock files to pull in updated Simperium and remove node-uuid dependency.

Update to package and lock files to pull in updated Simperium and remove node-uuid dependency.
@mirka mirka self-requested a review October 11, 2018 14:41
@mirka mirka added this to the 1.2.1 milestone Oct 12, 2018
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Thank you for this @acrosman !

I didn't expect this to be a breaking change, but I noticed that the logout request onSignOutRequested() was malfunctioning, and displaying a showUnsyncedWarning no matter what. Click the Log Out button in the Settings dialog, and you will always get an unsynced notes warning.

I debugged it, and turns out this is caused by a change in the Bucket method getVersion where it now relies on a this. Because we were using getVersion via destructuring assignment, this is undefined and it will throw an error. But our Promise.all swallows the error and rejects the whole thing with a showUnsyncedWarning() 😅

We can fix this by calling noteBucket.getVersion here instead of destructuring it:

const noteHasSynced = note =>
  new Promise((resolve, reject) =>
    noteBucket.getVersion(
      note.id,
      (e, v) => (e || v === 0 ? reject() : resolve())
    )
  );

@acrosman
Copy link
Contributor Author

Requested change included.

@mirka
Copy link
Member

mirka commented Oct 15, 2018

Thanks, we also need to remove this unnecessary line so it compiles.

@acrosman
Copy link
Contributor Author

Sorry about that, line removed.

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@mirka mirka merged commit d3dc317 into Automattic:master Oct 16, 2018
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.

None yet

2 participants