Skip to content

Commit 4b875f8

Browse files
author
Firefox Sync Engineering
committed
Nightly auto-update (130.0.20240717060503)
1 parent 0819405 commit 4b875f8

File tree

7 files changed

+89
-17
lines changed

7 files changed

+89
-17
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// swift-tools-version:5.4
22
import PackageDescription
33

4-
let checksum = "de53e236c3cc4ca4bb25814d0cbd9c9abbb16d72528914460e4a32e36c15c1df"
5-
let version = "130.0.20240713050324"
6-
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.130.20240713050324/artifacts/public/build/MozillaRustComponents.xcframework.zip"
4+
let checksum = "437a59a3ecc18c922570729cd6baed7497b07c0558425e5af32457fe38cd6016"
5+
let version = "130.0.20240717060503"
6+
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.130.20240717060503/artifacts/public/build/MozillaRustComponents.xcframework.zip"
77

88
// Focus xcframework
9-
let focusChecksum = "e2efd572da282d5714d1cd994b8e294fbe8fc7ae55b77790959faeeb7e93829a"
10-
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.130.20240713050324/artifacts/public/build/FocusRustComponents.xcframework.zip"
9+
let focusChecksum = "08158fd84c5366695a006ea97141b222755d954d8f507de8bf7b67631f418f72"
10+
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.130.20240717060503/artifacts/public/build/FocusRustComponents.xcframework.zip"
1111
let package = Package(
1212
name: "MozillaRustComponentsSwift",
1313
platforms: [.iOS(.v14)],

swift-source/all/FxAClient/FxAccountDeviceConstellation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class DeviceConstellation {
9595
try self.account.sendSingleTab(targetDeviceId: targetDeviceId, title: title, url: url)
9696
}
9797
case let .closeTabs(urls):
98-
try self.account.closeTabs(targetDeviceId: targetDeviceId, urls: urls)
98+
_ = try self.account.closeTabs(targetDeviceId: targetDeviceId, urls: urls)
9999
}
100100
} catch {
101101
FxALog.error("Error sending event to another device: \(error).")

swift-source/all/FxAClient/PersistedFirefoxAccount.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class PersistedFirefoxAccount {
189189
}
190190
}
191191

192-
public func closeTabs(targetDeviceId: String, urls: [String]) throws {
192+
public func closeTabs(targetDeviceId: String, urls: [String]) throws -> CloseTabsResult {
193193
return try notifyAuthErrors {
194194
try self.inner.closeTabs(targetDeviceId: targetDeviceId, urls: urls)
195195
}

swift-source/all/Generated/Metrics/Metrics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension GleanMetrics {
2323
// Intentionally left private, no external user can instantiate a new global object.
2424
}
2525

26-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 7, day: 13, hour: 5, minute: 12, second: 19))
26+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 7, day: 17, hour: 6, minute: 27, second: 14))
2727
}
2828

2929
enum NimbusEvents {

swift-source/all/Generated/fxa_client.swift

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public protocol FirefoxAccountProtocol: AnyObject {
473473
* If a device on the account has registered the [`CloseTabs`](DeviceCapability::CloseTabs)
474474
* capability, this method can be used to close its tabs.
475475
*/
476-
func closeTabs(targetDeviceId: String, urls: [String]) throws
476+
func closeTabs(targetDeviceId: String, urls: [String]) throws -> CloseTabsResult
477477

478478
func completeOauthFlow(code: String, state: String) throws
479479

@@ -642,11 +642,12 @@ open class FirefoxAccount:
642642
* If a device on the account has registered the [`CloseTabs`](DeviceCapability::CloseTabs)
643643
* capability, this method can be used to close its tabs.
644644
*/
645-
open func closeTabs(targetDeviceId: String, urls: [String]) throws { try rustCallWithError(FfiConverterTypeFxaError.lift) {
646-
uniffi_fxa_client_fn_method_firefoxaccount_close_tabs(self.uniffiClonePointer(),
647-
FfiConverterString.lower(targetDeviceId),
648-
FfiConverterSequenceString.lower(urls), $0)
649-
}
645+
open func closeTabs(targetDeviceId: String, urls: [String]) throws -> CloseTabsResult {
646+
return try FfiConverterTypeCloseTabsResult.lift(rustCallWithError(FfiConverterTypeFxaError.lift) {
647+
uniffi_fxa_client_fn_method_firefoxaccount_close_tabs(self.uniffiClonePointer(),
648+
FfiConverterString.lower(targetDeviceId),
649+
FfiConverterSequenceString.lower(urls), $0)
650+
})
650651
}
651652

652653
open func completeOauthFlow(code: String, state: String) throws { try rustCallWithError(FfiConverterTypeFxaError.lift) {
@@ -2141,6 +2142,77 @@ public func FfiConverterTypeAccountEvent_lower(_ value: AccountEvent) -> RustBuf
21412142

21422143
extension AccountEvent: Equatable, Hashable {}
21432144

2145+
// Note that we don't yet support `indirect` for enums.
2146+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
2147+
/**
2148+
* The result of invoking a "close tabs" command.
2149+
*
2150+
* If [`FirefoxAccount::close_tabs`] is called with more URLs than can fit
2151+
* into a single command payload, the URLs will be chunked and sent in
2152+
* multiple commands.
2153+
*
2154+
* Chunking breaks the atomicity of a "close tabs" command, but
2155+
* reduces the number of these commands that FxA sends to other devices.
2156+
* This is critical for platforms like iOS, where every command triggers a
2157+
* push message that must show a user-visible notification.
2158+
*/
2159+
2160+
public enum CloseTabsResult {
2161+
/**
2162+
* All URLs passed to [`FirefoxAccount::close_tabs`] were chunked and sent
2163+
* in one or more device commands.
2164+
*/
2165+
case ok
2166+
/**
2167+
* One or more URLs passed to [`FirefoxAccount::close_tabs`] couldn't be sent
2168+
* in a device command. The caller can assume that:
2169+
*
2170+
* 1. Any URL in the returned list of `urls` was not sent, and
2171+
* should be retried.
2172+
* 2. All other URLs that were passed to [`FirefoxAccount::close_tabs`], and
2173+
* that are _not_ in the list of `urls`, were chunked and sent.
2174+
*/
2175+
case tabsNotClosed(urls: [String]
2176+
)
2177+
}
2178+
2179+
public struct FfiConverterTypeCloseTabsResult: FfiConverterRustBuffer {
2180+
typealias SwiftType = CloseTabsResult
2181+
2182+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CloseTabsResult {
2183+
let variant: Int32 = try readInt(&buf)
2184+
switch variant {
2185+
case 1: return .ok
2186+
2187+
case 2: return try .tabsNotClosed(urls: FfiConverterSequenceString.read(from: &buf)
2188+
)
2189+
2190+
default: throw UniffiInternalError.unexpectedEnumCase
2191+
}
2192+
}
2193+
2194+
public static func write(_ value: CloseTabsResult, into buf: inout [UInt8]) {
2195+
switch value {
2196+
case .ok:
2197+
writeInt(&buf, Int32(1))
2198+
2199+
case let .tabsNotClosed(urls):
2200+
writeInt(&buf, Int32(2))
2201+
FfiConverterSequenceString.write(urls, into: &buf)
2202+
}
2203+
}
2204+
}
2205+
2206+
public func FfiConverterTypeCloseTabsResult_lift(_ buf: RustBuffer) throws -> CloseTabsResult {
2207+
return try FfiConverterTypeCloseTabsResult.lift(buf)
2208+
}
2209+
2210+
public func FfiConverterTypeCloseTabsResult_lower(_ value: CloseTabsResult) -> RustBuffer {
2211+
return FfiConverterTypeCloseTabsResult.lower(value)
2212+
}
2213+
2214+
extension CloseTabsResult: Equatable, Hashable {}
2215+
21442216
// Note that we don't yet support `indirect` for enums.
21452217
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
21462218

@@ -3100,7 +3172,7 @@ private var initializationResult: InitializationResult {
31003172
if uniffi_fxa_client_checksum_method_firefoxaccount_clear_device_name() != 42324 {
31013173
return InitializationResult.apiChecksumMismatch
31023174
}
3103-
if uniffi_fxa_client_checksum_method_firefoxaccount_close_tabs() != 64219 {
3175+
if uniffi_fxa_client_checksum_method_firefoxaccount_close_tabs() != 55044 {
31043176
return InitializationResult.apiChecksumMismatch
31053177
}
31063178
if uniffi_fxa_client_checksum_method_firefoxaccount_complete_oauth_flow() != 41338 {

swift-source/all/Generated/fxa_clientFFI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void uniffi_fxa_client_fn_method_firefoxaccount_clear_device_name(void*_Nonnull
303303
#endif
304304
#ifndef UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_CLOSE_TABS
305305
#define UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_CLOSE_TABS
306-
void uniffi_fxa_client_fn_method_firefoxaccount_close_tabs(void*_Nonnull ptr, RustBuffer target_device_id, RustBuffer urls, RustCallStatus *_Nonnull out_status
306+
RustBuffer uniffi_fxa_client_fn_method_firefoxaccount_close_tabs(void*_Nonnull ptr, RustBuffer target_device_id, RustBuffer urls, RustCallStatus *_Nonnull out_status
307307
);
308308
#endif
309309
#ifndef UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_COMPLETE_OAUTH_FLOW

swift-source/focus/Generated/Metrics/Metrics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension GleanMetrics {
2323
// Intentionally left private, no external user can instantiate a new global object.
2424
}
2525

26-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 7, day: 13, hour: 5, minute: 12, second: 22))
26+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 7, day: 17, hour: 6, minute: 27, second: 16))
2727
}
2828

2929
enum NimbusEvents {

0 commit comments

Comments
 (0)