-
Notifications
You must be signed in to change notification settings - Fork 226
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
base: main
Are you sure you want to change the base?
Conversation
@@ -51,6 +51,7 @@ impl Storage { | |||
CREATE TABLE IF NOT EXISTS collection_metadata ( | |||
collection_url TEXT PRIMARY KEY, | |||
last_modified INTEGER, | |||
metadata BLOB NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather storing each field metadata separately rather than serializing it into a single field. I don't feel very strongly about this one, though, feel free to push back on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also hesitated there.
The reason behind my choice is that eventually we will potentially look at other metadata fields, like attachment
to know whether there's a bundle to pull, or flags
to know whether a collection is required to have records during startup.
But, we can perfectly decide to put this aside, and add the additional columns only when we implement these features.
It depends a bit how confident we are in database migration for the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Database migrations should be pretty easy. I was tempted to add one in #6526, but I decided to leave it out. If you want, I can try to write up a PR that adds a trivial migration so you can see how they work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would definitely help yes please 🙏 Maybe a candidate would be the fetched
column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a bit distracted last week, but it's finally up: #6537.
There was a problem hiding this 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.
cbeee6b
to
68c8951
Compare
dca1f28
to
f8ead0e
Compare
f8ead0e
to
89d95d2
Compare
There was a problem hiding this 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!
There was a problem hiding this 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.
Ok(()) | ||
} | ||
#[test] | ||
fn test_storage_get_collection_content() -> Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn test_storage_get_collection_content() -> Result<()> { | |
fn test_storage_get_collection_metadata() -> Result<()> { |
@@ -105,6 +111,36 @@ impl Storage { | |||
result | |||
} | |||
|
|||
/// Get cached content for this collection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Get cached content for this collection | |
/// Get cached metadata for this collection |
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.
Pull Request checklist
[ci full]
to the PR title.Branch builds: add
[firefox-android: branch-name]
to the PR title.