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 how we handle validity and unknown bookmark types #2780

Merged
merged 2 commits into from
Mar 10, 2020

Conversation

linabutler
Copy link
Member

@linabutler linabutler commented Mar 10, 2020

Two small, internal changes:

  • I noticed we weren't using set_{reupload, replace} consistently when I was making the list of reasons in Dedupe existing bookmark tags and URLs #2775 (comment). The first commit cleans that up.
  • The second commit makes unknown bookmark types a hard error that we can monitor in telemetry, instead of papering over them. If it turns out to be an issue, we can store these items (with validity = Replace; Dogear would need to grow support for them as well) and replace them with tombstones.

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • automation/all_tests.sh runs to completion and produces no failures
    • Note: For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGES_UNRELEASED.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due dilligence applied in selecting them.

…kmarks.

Some of this logic was written before `set_reupload` and `set_replace`
existed. This commit replaces the mix of validity return values and
checks with calls to those functions everywhere.
@linabutler linabutler requested a review from eoger March 10, 2020 10:15
Copy link
Contributor

@eoger eoger left a comment

Choose a reason for hiding this comment

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

Thanks, now I know how set_replace/set_reupload work!

@eoger
Copy link
Contributor

eoger commented Mar 10, 2020

Do think there are other places that might need a similar fix? I could be a good opportunity for external contributors to explore the code base.

@linabutler
Copy link
Member Author

I could be a good opportunity for external contributors to explore the code base.

Definitely, I'll keep an eye out for other small refactors like this!

We can't support bookmarks with types that we don't know about.
Ignoring them is more likely to mask client bugs, and cause problems
with the tree structure, than anything else.

Let's make this a hard error for now, and monitor telemetry. If these
occur frequently, we can explore storing placeholders for them with
`Replace` validity.
@linabutler linabutler merged commit 57725e3 into master Mar 10, 2020
@linabutler linabutler deleted the small-validity-fixes branch March 10, 2020 16:26
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