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

Change the way how bookmarks are saved to handle merge errors #1432

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

bwaresiak
Copy link
Collaborator

@bwaresiak bwaresiak commented Aug 4, 2023

Task/Issue URL: https://app.asana.com/0/1201037661562251/1205176904769815/f
Tech Design URL:
CC:

Description:

Ensure merge errors (caused by other/concurrent context saves) does not cause save failures by reapplying the changes.

Steps to test this PR:

Smoke test Bookmarks feature.


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 42c6559

@bwaresiak bwaresiak marked this pull request as ready for review August 4, 2023 12:32
@bwaresiak bwaresiak requested a review from Bunn August 4, 2023 12:33
Copy link
Collaborator

@Bunn Bunn left a comment

Choose a reason for hiding this comment

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

LGTM. Small comment related to an unused self, but I don't really think it's an issue, just raising in case you do :)

Tested:

  • Adding/removing/editing bookmarks
  • Adding/removing/editing favorites
  • Importing from FF
  • Opening bookmarks from older version to make sure there's no lost data
  • Forcing a bad code path to send a pixel

let folderFetchRequestResults = try? self.context.fetch(folderFetchRequest)
do {
_ = try applyChangesAndSave(changes: { [weak self] context in
guard let self = self else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since self is not being used, maybe change it to
guard self != nil else { ?

@bwaresiak bwaresiak merged commit 931b3c4 into develop Aug 4, 2023
10 checks passed
@bwaresiak bwaresiak deleted the bartek/tweak-bookmark-saves branch August 4, 2023 17:28
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