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

Remote Settings: store full changesets instead of just records #6517

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

leplatrem
Copy link
Contributor

@leplatrem leplatrem commented Dec 5, 2024

In order to prepare the work of signature verification, where we want to be able to assess data integrity/authenticity, we need to store collection metadata and timestamps.

Also, this PR fixes an issue where the timestamp was wrong in certain cases (empty collections, tombstones, etc.)

It is an internal change that does not require a CHANGELOG entry.

  • Refactoring
  • Storing
  • Retrieving
  • Storage DB migration

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.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 diligence applied in selecting them.

Branch builds: add [firefox-android: branch-name] to the PR title.

Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

Looks like the right direction to me, thanks for working on this one.

components/remote_settings/src/storage.rs Show resolved Hide resolved
@leplatrem leplatrem force-pushed the remote-settings-store-metadata branch 2 times, most recently from cbeee6b to 68c8951 Compare December 18, 2024 16:17
@leplatrem leplatrem marked this pull request as ready for review December 18, 2024 16:18
@leplatrem leplatrem force-pushed the remote-settings-store-metadata branch 3 times, most recently from dca1f28 to f8ead0e Compare December 19, 2024 21:34
@leplatrem leplatrem requested a review from bendk December 19, 2024 21:40
@leplatrem leplatrem force-pushed the remote-settings-store-metadata branch from f8ead0e to 89d95d2 Compare December 19, 2024 21:55
Copy link
Member

@gruberb gruberb left a comment

Choose a reason for hiding this comment

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

Just some comments, looks good!

components/remote_settings/src/client.rs Outdated Show resolved Hide resolved
components/remote_settings/src/storage.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

This looks great to me. The one remaining issue is the database migration. I'll try to put up a PR one soon so that you can use it to base your work off.

components/remote_settings/src/storage.rs Outdated Show resolved Hide resolved
components/remote_settings/src/storage.rs Outdated Show resolved Hide resolved
components/remote_settings/src/storage.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

This looks great to me, are we ready to merge?

@@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS attachments (
data BLOB NOT NULL);
CREATE TABLE IF NOT EXISTS collection_metadata (
collection_url TEXT PRIMARY KEY,
last_modified INTEGER);
last_modified INTEGER, bucket TEXT, signature TEXT, x5u TEXT);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry you needed to format it like this to make the migration test work.

@leplatrem
Copy link
Contributor Author

This looks great to me, are we ready to merge?

Yes! I'll squash the commits and merge 👌

@leplatrem leplatrem force-pushed the remote-settings-store-metadata branch from 9450391 to 80ea542 Compare January 7, 2025 11:35
@leplatrem leplatrem force-pushed the remote-settings-store-metadata branch from 80ea542 to caa8fc6 Compare January 7, 2025 11:36
@leplatrem leplatrem added this pull request to the merge queue Jan 7, 2025
Merged via the queue into mozilla:main with commit d305778 Jan 7, 2025
15 checks passed
@leplatrem leplatrem deleted the remote-settings-store-metadata branch January 7, 2025 12:39
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.

3 participants