Bug 1965086 - Vendor app-services 72a070750ff979f4aac29da7c02a9cb6e53ac087, r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D248466
This commit is contained in:
committed by
bdeankawamura@mozilla.com
parent
daeadd1d46
commit
7b45ba29ff
@@ -70,9 +70,9 @@ git = "https://github.com/jfkthame/mapped_hyph.git"
|
|||||||
rev = "eff105f6ad7ec9b79816cfc1985a28e5340ad14b"
|
rev = "eff105f6ad7ec9b79816cfc1985a28e5340ad14b"
|
||||||
replace-with = "vendored-sources"
|
replace-with = "vendored-sources"
|
||||||
|
|
||||||
[source."git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197"]
|
[source."git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087"]
|
||||||
git = "https://github.com/mozilla/application-services"
|
git = "https://github.com/mozilla/application-services"
|
||||||
rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
replace-with = "vendored-sources"
|
replace-with = "vendored-sources"
|
||||||
|
|
||||||
[source."git+https://github.com/mozilla/audioipc?rev=e6f44a2bd1e57d11dfc737632a9e849077632330"]
|
[source."git+https://github.com/mozilla/audioipc?rev=e6f44a2bd1e57d11dfc737632a9e849077632330"]
|
||||||
|
|||||||
32
Cargo.lock
generated
32
Cargo.lock
generated
@@ -1894,7 +1894,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "error-support"
|
name = "error-support"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"error-support-macros",
|
"error-support-macros",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@@ -1906,7 +1906,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "error-support-macros"
|
name = "error-support-macros"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -2025,7 +2025,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "firefox-versioning"
|
name = "firefox-versioning"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror 1.999.999",
|
"thiserror 1.999.999",
|
||||||
@@ -3365,7 +3365,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "interrupt-support"
|
name = "interrupt-support"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
@@ -5086,7 +5086,7 @@ checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "payload-support"
|
name = "payload-support"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
@@ -5589,7 +5589,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "relevancy"
|
name = "relevancy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.21.999",
|
"base64 0.21.999",
|
||||||
@@ -5614,7 +5614,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "remote_settings"
|
name = "remote_settings"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"camino",
|
"camino",
|
||||||
@@ -5916,7 +5916,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "search"
|
name = "search"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"error-support",
|
"error-support",
|
||||||
"firefox-versioning",
|
"firefox-versioning",
|
||||||
@@ -6208,7 +6208,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "sql-support"
|
name = "sql-support"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"interrupt-support",
|
"interrupt-support",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@@ -6414,7 +6414,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "suggest"
|
name = "suggest"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -6466,7 +6466,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "sync-guid"
|
name = "sync-guid"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.999",
|
"base64 0.21.999",
|
||||||
"rand",
|
"rand",
|
||||||
@@ -6477,7 +6477,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "sync15"
|
name = "sync15"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"error-support",
|
"error-support",
|
||||||
@@ -6517,7 +6517,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "tabs"
|
name = "tabs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"error-support",
|
"error-support",
|
||||||
@@ -6861,7 +6861,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "types"
|
name = "types"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rusqlite 0.33.0",
|
"rusqlite 0.33.0",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -7264,7 +7264,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "viaduct"
|
name = "viaduct"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ffi-support",
|
"ffi-support",
|
||||||
"log",
|
"log",
|
||||||
@@ -7434,7 +7434,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "webext-storage"
|
name = "webext-storage"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/mozilla/application-services?rev=40ae79e2825fa242a349e17fcfc84fb99fd92197#40ae79e2825fa242a349e17fcfc84fb99fd92197"
|
source = "git+https://github.com/mozilla/application-services?rev=72a070750ff979f4aac29da7c02a9cb6e53ac087#72a070750ff979f4aac29da7c02a9cb6e53ac087"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"error-support",
|
"error-support",
|
||||||
|
|||||||
18
Cargo.toml
18
Cargo.toml
@@ -262,14 +262,14 @@ wr_malloc_size_of = { path = "gfx/wr/wr_malloc_size_of" }
|
|||||||
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
|
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
|
||||||
|
|
||||||
# application-services overrides to make updating them all simpler.
|
# application-services overrides to make updating them all simpler.
|
||||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
relevancy = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
relevancy = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
search = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
search = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
sql-support = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
sql-support = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
suggest = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
suggest = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
sync15 = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
sync15 = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
tabs = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
tabs = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
viaduct = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "40ae79e2825fa242a349e17fcfc84fb99fd92197" }
|
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "72a070750ff979f4aac29da7c02a9cb6e53ac087" }
|
||||||
|
|
||||||
allocator-api2 = { path = "third_party/rust/allocator-api2" }
|
allocator-api2 = { path = "third_party/rust/allocator-api2" }
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
78
third_party/rust/remote_settings/src/client.rs
vendored
78
third_party/rust/remote_settings/src/client.rs
vendored
@@ -507,9 +507,15 @@ impl RemoteSettingsClient<ViaductApiClient> {
|
|||||||
Self::new_from_parts(collection_name, storage, jexl_filter, api_client)
|
Self::new_from_parts(collection_name, storage, jexl_filter, api_client)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_config(&self, server_url: BaseUrl, bucket_name: String) -> Result<()> {
|
pub fn update_config(
|
||||||
|
&self,
|
||||||
|
server_url: BaseUrl,
|
||||||
|
bucket_name: String,
|
||||||
|
context: Option<RemoteSettingsContext>,
|
||||||
|
) -> Result<()> {
|
||||||
let mut inner = self.inner.lock();
|
let mut inner = self.inner.lock();
|
||||||
inner.api_client = ViaductApiClient::new(server_url, &bucket_name, &self.collection_name);
|
inner.api_client = ViaductApiClient::new(server_url, &bucket_name, &self.collection_name);
|
||||||
|
inner.jexl_filter = JexlFilter::new(context);
|
||||||
inner.storage.empty()
|
inner.storage.empty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2040,6 +2046,76 @@ mod jexl_tests {
|
|||||||
Some(vec![])
|
Some(vec![])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_update_jexl_context() {
|
||||||
|
let mut api_client = MockApiClient::new();
|
||||||
|
let records = vec![RemoteSettingsRecord {
|
||||||
|
id: "record-0001".into(),
|
||||||
|
last_modified: 100,
|
||||||
|
deleted: false,
|
||||||
|
attachment: None,
|
||||||
|
fields: serde_json::json!({
|
||||||
|
"filter_expression": "env.country == \"US\""
|
||||||
|
})
|
||||||
|
.as_object()
|
||||||
|
.unwrap()
|
||||||
|
.clone(),
|
||||||
|
}];
|
||||||
|
let changeset = ChangesetResponse {
|
||||||
|
changes: records.clone(),
|
||||||
|
timestamp: 42,
|
||||||
|
metadata: CollectionMetadata::default(),
|
||||||
|
};
|
||||||
|
api_client.expect_collection_url().returning(|| {
|
||||||
|
"http://rs.example.com/v1/buckets/main/collections/test-collection".into()
|
||||||
|
});
|
||||||
|
api_client.expect_fetch_changeset().returning({
|
||||||
|
let changeset = changeset.clone();
|
||||||
|
move |timestamp| {
|
||||||
|
assert_eq!(timestamp, None);
|
||||||
|
Ok(changeset.clone())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
api_client.expect_is_prod_server().returning(|| Ok(false));
|
||||||
|
|
||||||
|
let context = RemoteSettingsContext {
|
||||||
|
country: Some("US".to_string()),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut storage = Storage::new(":memory:".into());
|
||||||
|
let _ = storage.insert_collection_content(
|
||||||
|
"http://rs.example.com/v1/buckets/main/collections/test-collection",
|
||||||
|
&records,
|
||||||
|
42,
|
||||||
|
CollectionMetadata::default(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let rs_client = RemoteSettingsClient::new_from_parts(
|
||||||
|
"test-collection".into(),
|
||||||
|
storage,
|
||||||
|
JexlFilter::new(Some(context)),
|
||||||
|
api_client,
|
||||||
|
);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
rs_client.get_records(false).expect("Error getting records"),
|
||||||
|
Some(records)
|
||||||
|
);
|
||||||
|
|
||||||
|
// We can't call `update_config` directly, since that only works with a real API client.
|
||||||
|
// Instead, just execute the code from that method that updates the JEXL filter.
|
||||||
|
rs_client.inner.lock().jexl_filter = JexlFilter::new(Some(RemoteSettingsContext {
|
||||||
|
country: Some("UK".to_string()),
|
||||||
|
..Default::default()
|
||||||
|
}));
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
rs_client.get_records(false).expect("Error getting records"),
|
||||||
|
Some(vec![])
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "signatures")]
|
#[cfg(feature = "signatures")]
|
||||||
|
|||||||
@@ -105,12 +105,15 @@ impl RemoteSettingsService {
|
|||||||
let bucket_name = config.bucket_name.unwrap_or_else(|| String::from("main"));
|
let bucket_name = config.bucket_name.unwrap_or_else(|| String::from("main"));
|
||||||
let mut inner = self.inner.lock();
|
let mut inner = self.inner.lock();
|
||||||
for client in inner.active_clients() {
|
for client in inner.active_clients() {
|
||||||
client
|
client.internal.update_config(
|
||||||
.internal
|
base_url.clone(),
|
||||||
.update_config(base_url.clone(), bucket_name.clone())?;
|
bucket_name.clone(),
|
||||||
|
config.app_context.clone(),
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
inner.base_url = base_url;
|
inner.base_url = base_url;
|
||||||
inner.bucket_name = bucket_name;
|
inner.bucket_name = bucket_name;
|
||||||
|
inner.app_context = config.app_context;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user