From 4dc1bafc8fe8bdce5d2d8ee87c6975d5a87e34f7 Mon Sep 17 00:00:00 2001 From: Tarik Eshaq Date: Thu, 13 Oct 2022 14:59:47 -0400 Subject: [PATCH 1/2] Fixes name conflict in swift generated code --- .../src/main/java/mozilla/appservices/tabs/Guid.kt | 11 +++++++++++ components/tabs/src/lib.rs | 8 ++++---- components/tabs/src/tabs.udl | 4 ++-- 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 components/tabs/android/src/main/java/mozilla/appservices/tabs/Guid.kt diff --git a/components/tabs/android/src/main/java/mozilla/appservices/tabs/Guid.kt b/components/tabs/android/src/main/java/mozilla/appservices/tabs/Guid.kt new file mode 100644 index 0000000000..4ef99a6882 --- /dev/null +++ b/components/tabs/android/src/main/java/mozilla/appservices/tabs/Guid.kt @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +@file:Suppress("InvalidPackageDeclaration") +package mozilla.appservices.remotetabs + +// We needed to rename the Rust `TabsGuid` struct to `Guid` in order to circumvent the naming conflict in +// iOS with the Guid exposed in `places.udl`. But that creates a breaking change for the Android code. So we are aliasing +// `TabsGuid` back to `Guid` to prevent a breaking change. +typealias Guid = TabsGuid diff --git a/components/tabs/src/lib.rs b/components/tabs/src/lib.rs index 0a02633924..a7010b71f1 100644 --- a/components/tabs/src/lib.rs +++ b/components/tabs/src/lib.rs @@ -15,12 +15,12 @@ mod sync; uniffi_macros::include_scaffolding!("tabs"); // Our UDL uses a `Guid` type. -use sync_guid::Guid; -impl UniffiCustomTypeConverter for Guid { +use sync_guid::Guid as TabsGuid; +impl UniffiCustomTypeConverter for TabsGuid { type Builtin = String; - fn into_custom(val: Self::Builtin) -> uniffi::Result { - Ok(Guid::new(val.as_str())) + fn into_custom(val: Self::Builtin) -> uniffi::Result { + Ok(TabsGuid::new(val.as_str())) } fn from_custom(obj: Self) -> Self::Builtin { diff --git a/components/tabs/src/tabs.udl b/components/tabs/src/tabs.udl index e411457064..abbe020265 100644 --- a/components/tabs/src/tabs.udl +++ b/components/tabs/src/tabs.udl @@ -1,5 +1,5 @@ [Custom] -typedef string Guid; +typedef string TabsGuid; namespace tabs { @@ -95,7 +95,7 @@ interface TabsBridgedEngine { sequence apply(); [Throws=TabsError] - void set_uploaded(i64 new_timestamp, sequence uploaded_ids); + void set_uploaded(i64 new_timestamp, sequence uploaded_ids); [Throws=TabsError] void sync_finished(); From 311f3dbf899fd2fe887826822d82617e83d41d91 Mon Sep 17 00:00:00 2001 From: Tarik Eshaq Date: Thu, 13 Oct 2022 15:05:58 -0400 Subject: [PATCH 2/2] Adds changelog --- CHANGES_UNRELEASED.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES_UNRELEASED.md b/CHANGES_UNRELEASED.md index 329f07a0de..fa3b081c10 100644 --- a/CHANGES_UNRELEASED.md +++ b/CHANGES_UNRELEASED.md @@ -18,3 +18,7 @@ Use the template below to make assigning a version number during the release cut - Description of the change with a link to the pull request ([#0000](https://github.com/mozilla/application-services/pull/0000)) --> + +## General +### What's fixed +- Fixed a bug released in 94.3.1. The bug broke firefox-ios builds due to a name conflict. ([#5181](https://github.com/mozilla/application-services/pull/5181)) \ No newline at end of file