Skip to content

Commit 60def6f

Browse files
author
Daisuke Akatsuka
committed
Bug 1961338: Vendor application-services into mozilla-central r=adw
Differential Revision: https://phabricator.services.mozilla.com/D246025
1 parent ae788ae commit 60def6f

File tree

14 files changed

+328
-283
lines changed

14 files changed

+328
-283
lines changed

.cargo/config.toml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ git = "https://github.com/jfkthame/mapped_hyph.git"
7070
rev = "eff105f6ad7ec9b79816cfc1985a28e5340ad14b"
7171
replace-with = "vendored-sources"
7272

73-
[source."git+https://github.com/mozilla/application-services?rev=6a007c98292fa72965d36389ce32d7609e399217"]
73+
[source."git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"]
7474
git = "https://github.com/mozilla/application-services"
75-
rev = "6a007c98292fa72965d36389ce32d7609e399217"
75+
rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
7676
replace-with = "vendored-sources"
7777

7878
[source."git+https://github.com/mozilla/audioipc?rev=e6f44a2bd1e57d11dfc737632a9e849077632330"]

Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
259259
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
260260

261261
# application-services overrides to make updating them all simpler.
262-
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
263-
relevancy = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
264-
search = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
265-
sql-support = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
266-
suggest = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
267-
sync15 = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
268-
tabs = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
269-
viaduct = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
270-
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "6a007c98292fa72965d36389ce32d7609e399217" }
262+
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
263+
relevancy = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
264+
search = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
265+
sql-support = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
266+
suggest = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
267+
sync15 = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
268+
tabs = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
269+
viaduct = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
270+
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
271271

272272
allocator-api2 = { path = "third_party/rust/allocator-api2" }

browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_yelp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const REMOTE_SETTINGS_RECORDS = [
1212
subjects: ["ramen"],
1313
preModifiers: ["best"],
1414
postModifiers: ["delivery"],
15-
locationSigns: ["in"],
15+
locationSigns: [{ keyword: "in", needLocation: true }],
1616
yelpModifiers: [],
1717
icon: "1234",
1818
score: 0.5,

browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_yelp.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ const REMOTE_SETTINGS_RECORDS = [
1515
subjects: ["ramen", "ab", "alongerkeyword", "1234"],
1616
preModifiers: ["best"],
1717
postModifiers: ["delivery"],
18-
locationSigns: ["in", "nearby"],
18+
locationSigns: [
19+
{ keyword: "in", needLocation: true },
20+
{ keyword: "nearby", needLocation: false },
21+
],
1922
yelpModifiers: [],
2023
icon: "1234",
2124
score: 0.5,
@@ -86,8 +89,8 @@ add_task(async function basic() {
8689
description: "No specific location with location-modifier",
8790
query: "ramen nearby",
8891
expected: {
89-
url: "https://www.yelp.com/search?find_desc=ramen&find_loc=Yokohama%2C+Kanagawa",
90-
title: "ramen nearby Yokohama, Kanagawa",
92+
url: "https://www.yelp.com/search?find_desc=ramen+nearby&find_loc=Yokohama%2C+Kanagawa",
93+
title: "ramen nearby in Yokohama, Kanagawa",
9194
},
9295
},
9396
{

browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_yelp_ml.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ const REMOTE_SETTINGS_RECORDS = [
1919
subjects: ["coffee"],
2020
preModifiers: [],
2121
postModifiers: [],
22-
locationSigns: ["in", "nearby"],
22+
locationSigns: [
23+
{ keyword: "in", needLocation: true },
24+
{ keyword: "nearby", needLocation: false },
25+
],
2326
yelpModifiers: [],
2427
icon: "1234",
2528
score: 0.5,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"files":{"Cargo.toml":"922b2e4d85f325dbef99d5e439558a75dbfda82e1d263c2dd3bfadac9879df18","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"5909dfb1e62793afb1f2bc15b75914527a4d14fce6796307c04a309e45c0598c","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"e5897d4e2eda06809fa6dc6db4e780b9ef266f613fb113aa6613b83f7005dd0b","src/benchmarks/geoname.rs":"00fab05cf9465cf8e22e143cde75a81885411001b240af00efda4071975d0563","src/benchmarks/ingest.rs":"1f3b5eca704c51bc8f972e7a3492a518516461e5834f97a5f7d1855a048ab16b","src/benchmarks/mod.rs":"24751c377f549ead6b6e1d46685c649f51303cc090f6374c93633f71dcf3cadf","src/benchmarks/query.rs":"d54946063e72cf98e7f46d94665c17c66af637774c2bb50cd5798dbe63d74f3c","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0ca876e845841bb6429862c0904c82265003f53b55aea053fac60aed278586a7","src/db.rs":"b4f1b46984ff5a6806546aa2acb2f4c5de3da2d067b3d42e0e7d13c2279ffcf1","src/error.rs":"e2ef3ec0e0b2b8ecbb8f2f1717d4cb753af06913b8395d086b7643098ad100a7","src/fakespot.rs":"f501c9fe5296e7c130a9fcb532b861465717652cb5ef688230bc7a3b94df91b1","src/geoname.rs":"77376dbc7d06532a7797a93b863f150317df7f31d9200d375c8ea489ac8bee6f","src/lib.rs":"a4c0989a01a7c13184049c1f11bc7813cd3cbfb6354fcca1f5a7204e45a0dc9c","src/metrics.rs":"871f0d834efbbc9e26d61f66fa31f0021dcf41444746cd7c082f93ba9628e399","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"cf00114a4293a4c9d956efffb8a6859f3568ea0e4868c6b63b8273daca69b0d5","src/query.rs":"66f229272c9245eb8ee0cab237071627aec599f145f64da8894bcaeb1ed7c6f9","src/rs.rs":"f539abfa9997a0711c6a2bd9ae616698eaa5b89983b667d2b9881cfb9635b7b2","src/schema.rs":"206c3cf7198783b8fa8a7b3039a538f8408a0a7eeb1331adf1b8022e14f46a2b","src/store.rs":"a2bd55aa9b686a80d59eacef9ddf43bbdc9fffb995af4a85c24fbe48bfd17ba6","src/suggestion.rs":"e74abdc1eace082ad7ed8762bcee25b1943ec3d04d7e644959c5737b42732660","src/testing/client.rs":"47a32fd84c733001f11e8bfff94dc8c060b6b0780346dca5ddc7a5f5489c1d85","src/testing/data.rs":"6b3dad0414dd862d939f31672547e33a852056e8f891cfec9c1a9cc9fb91d54d","src/testing/mod.rs":"34120abb160a913069c3f7df03c4f52815be3461dbbf08fb0fcc4251a517ba71","src/util.rs":"52c6ec405637afa2d1a89f29fbbb7dcc341546b6deb97d326c4490bbf8713cb0","src/weather.rs":"7cc9167dcdfca49d6ad91eba6fba4d5fd49f45052f25a7fe3ad6749d3e6783fb","src/yelp.rs":"4e7cf36318c061bf73e20e52b05d8b1c6a0a904129594d92dddeb071ea52db93","uniffi.toml":"8205e4679ac26d53e70af0f85c013fd27cda1119f4322aebf5f2b9403d45a611"},"package":null}
1+
{"files":{"Cargo.toml":"922b2e4d85f325dbef99d5e439558a75dbfda82e1d263c2dd3bfadac9879df18","README.md":"5e28baf874b643d756228bdab345e287bf107d3182dfe6a18aafadcc4b9a3fc9","benches/benchmark_all.rs":"5909dfb1e62793afb1f2bc15b75914527a4d14fce6796307c04a309e45c0598c","metrics.yaml":"0540ab2271aeab7f07335c7ceec12acde942995f9dcb3c29070489aa61899d56","src/benchmarks/README.md":"ccee8dbddba8762d0453fa855bd6984137b224b8c019f3dd8e86a3c303f51d71","src/benchmarks/client.rs":"e5897d4e2eda06809fa6dc6db4e780b9ef266f613fb113aa6613b83f7005dd0b","src/benchmarks/geoname.rs":"00fab05cf9465cf8e22e143cde75a81885411001b240af00efda4071975d0563","src/benchmarks/ingest.rs":"1f3b5eca704c51bc8f972e7a3492a518516461e5834f97a5f7d1855a048ab16b","src/benchmarks/mod.rs":"24751c377f549ead6b6e1d46685c649f51303cc090f6374c93633f71dcf3cadf","src/benchmarks/query.rs":"d54946063e72cf98e7f46d94665c17c66af637774c2bb50cd5798dbe63d74f3c","src/bin/debug_ingestion_sizes.rs":"ce6e810be7b3fc19e826d75b622b82cfab5a1a99397a6d0833c2c4eebff2d364","src/config.rs":"0ca876e845841bb6429862c0904c82265003f53b55aea053fac60aed278586a7","src/db.rs":"566e62ab951c0a372450ffb8842ded85a0147242cf191254d895dc0fe320a58c","src/error.rs":"e2ef3ec0e0b2b8ecbb8f2f1717d4cb753af06913b8395d086b7643098ad100a7","src/fakespot.rs":"f501c9fe5296e7c130a9fcb532b861465717652cb5ef688230bc7a3b94df91b1","src/geoname.rs":"77376dbc7d06532a7797a93b863f150317df7f31d9200d375c8ea489ac8bee6f","src/lib.rs":"a4c0989a01a7c13184049c1f11bc7813cd3cbfb6354fcca1f5a7204e45a0dc9c","src/metrics.rs":"871f0d834efbbc9e26d61f66fa31f0021dcf41444746cd7c082f93ba9628e399","src/pocket.rs":"1316668840ec9b4ea886223921dc9d3b5a1731d1a5206c0b1089f2a6c45c1b7b","src/provider.rs":"cf00114a4293a4c9d956efffb8a6859f3568ea0e4868c6b63b8273daca69b0d5","src/query.rs":"66f229272c9245eb8ee0cab237071627aec599f145f64da8894bcaeb1ed7c6f9","src/rs.rs":"37cce2cb0068421f6b40e13f3bcb1f6212acee2f7117759cd095d381b25580f8","src/schema.rs":"51dfe27c01884dfbd3bb7c868c01505dd69cf119d9bb37ddb653f77ead170956","src/store.rs":"d127c58e26a3e380e815e11e6660feb58df335ab40426aa051902a6fec659b5a","src/suggestion.rs":"e74abdc1eace082ad7ed8762bcee25b1943ec3d04d7e644959c5737b42732660","src/testing/client.rs":"47a32fd84c733001f11e8bfff94dc8c060b6b0780346dca5ddc7a5f5489c1d85","src/testing/data.rs":"5b1935946185f55be2383f2f979e966155825b1b9df7913d93eb50289052639c","src/testing/mod.rs":"34120abb160a913069c3f7df03c4f52815be3461dbbf08fb0fcc4251a517ba71","src/util.rs":"52c6ec405637afa2d1a89f29fbbb7dcc341546b6deb97d326c4490bbf8713cb0","src/weather.rs":"7cc9167dcdfca49d6ad91eba6fba4d5fd49f45052f25a7fe3ad6749d3e6783fb","src/yelp.rs":"0b9dfa698d9c3162d47c0103d1799838d444345f9d7f943eedc6bcc98fd8b57d","uniffi.toml":"8205e4679ac26d53e70af0f85c013fd27cda1119f4322aebf5f2b9403d45a611"},"package":null}

third_party/rust/suggest/src/db.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,11 @@ impl<'a> SuggestDao<'a> {
13401340
named_params! { ":record_id": record_id.as_str() },
13411341
)?;
13421342
self.scope.err_if_interrupted()?;
1343+
self.conn.execute_cached(
1344+
"DELETE FROM yelp_location_signs WHERE record_id = :record_id",
1345+
named_params! { ":record_id": record_id.as_str() },
1346+
)?;
1347+
self.scope.err_if_interrupted()?;
13431348
self.conn.execute_cached(
13441349
"DELETE FROM yelp_custom_details WHERE record_id = :record_id",
13451350
named_params! { ":record_id": record_id.as_str() },

third_party/rust/suggest/src/rs.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ use serde_json::{Map, Value};
4242

4343
use crate::{error::Error, query::full_keywords_to_fts_content, Result};
4444

45-
use rusqlite::{types::ToSqlOutput, ToSql};
46-
4745
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4846
pub enum Collection {
4947
Amp,
@@ -455,21 +453,12 @@ pub(crate) struct DownloadedPocketSuggestion {
455453
pub high_confidence_keywords: Vec<String>,
456454
pub score: f64,
457455
}
458-
/// Yelp location sign data type
456+
/// A location sign for Yelp to ingest from a Yelp Attachment
459457
#[derive(Clone, Debug, Deserialize)]
460-
#[serde(untagged)]
461-
pub enum DownloadedYelpLocationSign {
462-
V1 { keyword: String },
463-
V2(String),
464-
}
465-
impl ToSql for DownloadedYelpLocationSign {
466-
fn to_sql(&self) -> rusqlite::Result<ToSqlOutput<'_>> {
467-
let keyword = match self {
468-
DownloadedYelpLocationSign::V1 { keyword } => keyword,
469-
DownloadedYelpLocationSign::V2(keyword) => keyword,
470-
};
471-
Ok(ToSqlOutput::from(keyword.as_str()))
472-
}
458+
pub(crate) struct DownloadedYelpLocationSign {
459+
pub keyword: String,
460+
#[serde(rename = "needLocation")]
461+
pub need_location: bool,
473462
}
474463
/// A Yelp suggestion to ingest from a Yelp Attachment
475464
#[derive(Clone, Debug, Deserialize)]

0 commit comments

Comments
 (0)