Skip to content

Commit c3a40bc

Browse files
github-actions[bot]Firefox Sync Engineering
andauthored
Auto update with latest AS Release v95.0.0 (#81)
* Updates Package.swift with v95.0.0 release * Version 95.0.0 Co-authored-by: Firefox Sync Engineering <[email protected]>
1 parent 0470b9f commit c3a40bc

28 files changed

+1378
-991
lines changed

Package.swift

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

4-
let checksum = "351cf3f6ec32d7ebd984ce1a5cd8349e6169c5f4ee2c5dd5a77082650c2a3486"
5-
let version = "v94.3.0"
4+
let checksum = "0bef856d3bfbf6df0b80fa9cab20b300bf27480fa476c55473380e1da6e34e81"
5+
let version = "v95.0.0"
66
let url = "https://github.com/mozilla/application-services/releases/download/\(version)/MozillaRustComponents.xcframework.zip"
77

88
// Focus xcframework
9-
let focusChecksum = "beac72a1fd86e489fc0bd404a9acf0c67990af06287d22e80a4f0bb0b228c9ea"
9+
let focusChecksum = "6bfd3351e0344f62d1d52b1c134bcd793476dfe43400f73582733933edf815f1"
1010
let focusUrl = "https://github.com/mozilla/application-services/releases/download/\(version)/FocusRustComponents.xcframework.zip"
1111
let package = Package(
1212
name: "MozillaRustComponentsSwift",

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

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// -*- mode: Swift -*-
22

3-
// AUTOGENERATED BY glean_parser v6.2.0. DO NOT EDIT. DO NOT COMMIT.
3+
// AUTOGENERATED BY glean_parser v6.2.1. DO NOT EDIT. DO NOT COMMIT.
44

55
#if canImport(Foundation)
66
import Foundation
@@ -26,14 +26,15 @@ extension GleanMetrics {
2626
// Intentionally left private, no external user can instantiate a new global object.
2727
}
2828

29-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 9, day: 21, hour: 15, minute: 7, second: 42))
29+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 11, day: 1, hour: 15, minute: 7, second: 10))
3030
}
3131

3232
enum NimbusEvents {
3333
struct EnrollmentExtra: EventExtras {
3434
var branch: String?
3535
var enrollmentId: String?
3636
var experiment: String?
37+
var experimentType: String?
3738

3839
func toExtraRecord() -> [String: String] {
3940
var record = [String: String]()
@@ -47,6 +48,31 @@ extension GleanMetrics {
4748
if let experiment = self.experiment {
4849
record["experiment"] = String(experiment)
4950
}
51+
if let experimentType = self.experimentType {
52+
record["experiment_type"] = String(experimentType)
53+
}
54+
55+
return record
56+
}
57+
}
58+
59+
struct EnrollFailedExtra: EventExtras {
60+
var branch: String?
61+
var experiment: String?
62+
var reason: String?
63+
64+
func toExtraRecord() -> [String: String] {
65+
var record = [String: String]()
66+
67+
if let branch = self.branch {
68+
record["branch"] = String(branch)
69+
}
70+
if let experiment = self.experiment {
71+
record["experiment"] = String(experiment)
72+
}
73+
if let reason = self.reason {
74+
record["reason"] = String(reason)
75+
}
5076

5177
return record
5278
}
@@ -56,6 +82,7 @@ extension GleanMetrics {
5682
var branch: String?
5783
var enrollmentId: String?
5884
var experiment: String?
85+
var reason: String?
5986

6087
func toExtraRecord() -> [String: String] {
6188
var record = [String: String]()
@@ -69,6 +96,27 @@ extension GleanMetrics {
6996
if let experiment = self.experiment {
7097
record["experiment"] = String(experiment)
7198
}
99+
if let reason = self.reason {
100+
record["reason"] = String(reason)
101+
}
102+
103+
return record
104+
}
105+
}
106+
107+
struct UnenrollFailedExtra: EventExtras {
108+
var experiment: String?
109+
var reason: String?
110+
111+
func toExtraRecord() -> [String: String] {
112+
var record = [String: String]()
113+
114+
if let experiment = self.experiment {
115+
record["experiment"] = String(experiment)
116+
}
117+
if let reason = self.reason {
118+
record["reason"] = String(reason)
119+
}
72120

73121
return record
74122
}
@@ -98,21 +146,21 @@ extension GleanMetrics {
98146

99147
struct ExposureExtra: EventExtras {
100148
var branch: String?
101-
var enrollmentId: String?
102149
var experiment: String?
150+
var featureId: String?
103151

104152
func toExtraRecord() -> [String: String] {
105153
var record = [String: String]()
106154

107155
if let branch = self.branch {
108156
record["branch"] = String(branch)
109157
}
110-
if let enrollmentId = self.enrollmentId {
111-
record["enrollment_id"] = String(enrollmentId)
112-
}
113158
if let experiment = self.experiment {
114159
record["experiment"] = String(experiment)
115160
}
161+
if let featureId = self.featureId {
162+
record["feature_id"] = String(featureId)
163+
}
116164

117165
return record
118166
}
@@ -129,7 +177,19 @@ extension GleanMetrics {
129177
lifetime: .ping,
130178
disabled: false
131179
)
132-
, ["branch", "enrollment_id", "experiment"]
180+
, ["branch", "enrollment_id", "experiment", "experiment_type"]
181+
)
182+
183+
/// Recorded when an enrollment fails, including the reason for the failure.
184+
static let enrollFailed = EventMetricType<NoExtraKeys, EnrollFailedExtra>( // generated from nimbus_events.enroll_failed
185+
CommonMetricData(
186+
category: "nimbus_events",
187+
name: "enroll_failed",
188+
sendInPings: ["background-update", "events"],
189+
lifetime: .ping,
190+
disabled: false
191+
)
192+
, ["branch", "experiment", "reason"]
133193
)
134194

135195
/// Recorded when either telemetry is disabled, or the experiment has run for its
@@ -143,7 +203,19 @@ extension GleanMetrics {
143203
lifetime: .ping,
144204
disabled: false
145205
)
146-
, ["branch", "enrollment_id", "experiment"]
206+
, ["branch", "enrollment_id", "experiment", "reason"]
207+
)
208+
209+
/// Recorded when an unenrollment fails, including the reason for the failure.
210+
static let unenrollFailed = EventMetricType<NoExtraKeys, UnenrollFailedExtra>( // generated from nimbus_events.unenroll_failed
211+
CommonMetricData(
212+
category: "nimbus_events",
213+
name: "unenroll_failed",
214+
sendInPings: ["background-update", "events"],
215+
lifetime: .ping,
216+
disabled: false
217+
)
218+
, ["experiment", "reason"]
147219
)
148220

149221
/// Recorded when a user becomes ineligible to continue receiving the treatment for
@@ -171,7 +243,7 @@ extension GleanMetrics {
171243
lifetime: .ping,
172244
disabled: false
173245
)
174-
, ["branch", "enrollment_id", "experiment"]
246+
, ["branch", "experiment", "feature_id"]
175247
)
176248

177249
}
@@ -213,7 +285,7 @@ extension GleanMetrics {
213285
name: "sdk_unavailable_for_feature",
214286
sendInPings: ["events"],
215287
lifetime: .ping,
216-
disabled: false
288+
disabled: true
217289
)
218290
, ["feature_id"]
219291
)
@@ -226,7 +298,7 @@ extension GleanMetrics {
226298
name: "cache_not_ready_for_feature",
227299
sendInPings: ["events"],
228300
lifetime: .ping,
229-
disabled: false
301+
disabled: true
230302
)
231303
, ["feature_id"]
232304
)

swift-source/all/Generated/errorFFI.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,27 @@ typedef struct RustCallStatus {
4646
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
4747
#endif // def UNIFFI_SHARED_H
4848

49-
void ffi_errorsupport_b986_ApplicationErrorReporter_init_callback(
49+
void ffi_errorsupport_4a62_ApplicationErrorReporter_init_callback(
5050
ForeignCallback _Nonnull callback_stub,
5151
RustCallStatus *_Nonnull out_status
5252
);
53-
void errorsupport_b986_set_application_error_reporter(
53+
void errorsupport_4a62_set_application_error_reporter(
5454
uint64_t error_reporter,
5555
RustCallStatus *_Nonnull out_status
5656
);
57-
RustBuffer ffi_errorsupport_b986_rustbuffer_alloc(
57+
RustBuffer ffi_errorsupport_4a62_rustbuffer_alloc(
5858
int32_t size,
5959
RustCallStatus *_Nonnull out_status
6060
);
61-
RustBuffer ffi_errorsupport_b986_rustbuffer_from_bytes(
61+
RustBuffer ffi_errorsupport_4a62_rustbuffer_from_bytes(
6262
ForeignBytes bytes,
6363
RustCallStatus *_Nonnull out_status
6464
);
65-
void ffi_errorsupport_b986_rustbuffer_free(
65+
void ffi_errorsupport_4a62_rustbuffer_free(
6666
RustBuffer buf,
6767
RustCallStatus *_Nonnull out_status
6868
);
69-
RustBuffer ffi_errorsupport_b986_rustbuffer_reserve(
69+
RustBuffer ffi_errorsupport_4a62_rustbuffer_reserve(
7070
RustBuffer buf,int32_t additional,
7171
RustCallStatus *_Nonnull out_status
7272
);

swift-source/all/Generated/errorsupport.swift

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ private extension RustBuffer {
1919
}
2020

2121
static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
22-
try! rustCall { ffi_errorsupport_b986_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
22+
try! rustCall { ffi_errorsupport_4a62_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
2323
}
2424

2525
// Frees the buffer in place.
2626
// The buffer must not be used after this is called.
2727
func deallocate() {
28-
try! rustCall { ffi_errorsupport_b986_rustbuffer_free(self, $0) }
28+
try! rustCall { ffi_errorsupport_4a62_rustbuffer_free(self, $0) }
2929
}
3030
}
3131

@@ -430,25 +430,40 @@ private let foreignCallbackCallbackInterfaceApplicationErrorReporter: ForeignCal
430430
// https://github.com/mozilla/uniffi-rs/issues/351
431431
}
432432

433-
let cb = try! FfiConverterCallbackInterfaceApplicationErrorReporter.lift(handle)
433+
let cb: ApplicationErrorReporter
434+
do {
435+
cb = try FfiConverterCallbackInterfaceApplicationErrorReporter.lift(handle)
436+
} catch {
437+
out_buf.pointee = FfiConverterString.lower("ApplicationErrorReporter: Invalid handle")
438+
return -1
439+
}
440+
434441
switch method {
435442
case IDX_CALLBACK_FREE:
436443
FfiConverterCallbackInterfaceApplicationErrorReporter.drop(handle: handle)
437444
// No return value.
438445
// See docs of ForeignCallback in `uniffi/src/ffi/foreigncallbacks.rs`
439446
return 0
440447
case 1:
441-
let buffer = try! invokeReportError(cb, args)
442-
out_buf.pointee = buffer
443-
// Value written to out buffer.
444-
// See docs of ForeignCallback in `uniffi/src/ffi/foreigncallbacks.rs`
445-
return 1
448+
do {
449+
out_buf.pointee = try invokeReportError(cb, args)
450+
// Value written to out buffer.
451+
// See docs of ForeignCallback in `uniffi/src/ffi/foreigncallbacks.rs`
452+
return 1
453+
} catch {
454+
out_buf.pointee = FfiConverterString.lower(String(describing: error))
455+
return -1
456+
}
446457
case 2:
447-
let buffer = try! invokeReportBreadcrumb(cb, args)
448-
out_buf.pointee = buffer
449-
// Value written to out buffer.
450-
// See docs of ForeignCallback in `uniffi/src/ffi/foreigncallbacks.rs`
451-
return 1
458+
do {
459+
out_buf.pointee = try invokeReportBreadcrumb(cb, args)
460+
// Value written to out buffer.
461+
// See docs of ForeignCallback in `uniffi/src/ffi/foreigncallbacks.rs`
462+
return 1
463+
} catch {
464+
out_buf.pointee = FfiConverterString.lower(String(describing: error))
465+
return -1
466+
}
452467

453468
// This should never happen, because an out of bounds method index won't
454469
// ever be used. Once we can catch errors, we should return an InternalError.
@@ -466,7 +481,7 @@ private enum FfiConverterCallbackInterfaceApplicationErrorReporter {
466481
private static var callbackInitialized = false
467482
private static func initCallback() {
468483
try! rustCall { (err: UnsafeMutablePointer<RustCallStatus>) in
469-
ffi_errorsupport_b986_ApplicationErrorReporter_init_callback(foreignCallbackCallbackInterfaceApplicationErrorReporter, err)
484+
ffi_errorsupport_4a62_ApplicationErrorReporter_init_callback(foreignCallbackCallbackInterfaceApplicationErrorReporter, err)
470485
}
471486
}
472487

@@ -518,7 +533,7 @@ public func setApplicationErrorReporter(errorReporter: ApplicationErrorReporter)
518533
try!
519534

520535
rustCall {
521-
errorsupport_b986_set_application_error_reporter(
536+
errorsupport_4a62_set_application_error_reporter(
522537
FfiConverterCallbackInterfaceApplicationErrorReporter.lower(errorReporter), $0
523538
)
524539
}

0 commit comments

Comments
 (0)