Skip to content

Commit

Permalink
Upgrade to core v14.13.0 (#8689)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne authored Sep 21, 2024
1 parent 410927c commit 2d07f5c
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 118 deletions.
186 changes: 93 additions & 93 deletions .github/workflows/build-pr.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/master-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "master"
- "release/**"
env:
XCODE_VERSION: "['15.3', '15.4', '16_Release_Candidate', '16.1_beta']"
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_2']"
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']"
DOC_VERSION: '15.4'
RELEASE_VERSION: '15.4'
Expand Down
12 changes: 5 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ The minimum supported version of Xcode is now 15.3.
using Xcode 16 in Swift 5 mode due to the removal of implicit isolation when
using property wrappers on member variables. This resulted in some new
sendability warnings in Xcode 16 (or errors in Swift 6 mode).
* Add Xcode 16 and 16.1 binaries to the release packages (currently built with
beta 6 and beta 1 respectively).
* Add Xcode 16 and 16.1 binaries to the release packages.

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-swift/issues/????), since v?.?.?)
* None.

<!-- ### Breaking Changes - ONLY INCLUDE FOR NEW MAJOR version -->
* Having a query with a number of predicates ORed together may result in a
crash on some platforms (strict weak ordering check failing on iphone)
([#8028](https://github.com/realm/realm-core/issues/8028), since v10.50.0)

### Compatibility
* Realm Studio: 15.0.0 or later.
Expand All @@ -44,7 +42,7 @@ The minimum supported version of Xcode is now 15.3.
* Xcode: 15.3.0-16.1 beta.

### Internal
* Upgraded realm-core from ? to ?
* Upgraded realm-core from v14.12.1 to 14.13.0

10.53.1 Release notes (2024-09-05)
=============================================================
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription
import Foundation

let coreVersion = Version("14.12.1")
let coreVersion = Version("14.13.0")
let cocoaVersion = Version("10.53.1")

#if compiler(>=6)
Expand Down
8 changes: 3 additions & 5 deletions Realm/ObjectServerTests/RealmServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ extension URLSession {
completionHandler(.success(data))
} else if let error = error {
completionHandler(.failure(error))
// swiftlint:disable:next non_optional_string_data_conversion
} else if let data = data, let string = String(data: data, encoding: .utf8) {
completionHandler(.failure(NSError(domain: URLError.errorDomain,
code: URLError.badServerResponse.rawValue,
Expand Down Expand Up @@ -657,7 +656,6 @@ final public class RealmServer: NSObject, Sendable {
let pipe = Pipe()
pipe.fileHandleForReading.readabilityHandler = { file in
guard file.availableData.count > 0,
// swiftlint:disable:next non_optional_string_data_conversion
let available = String(data: file.availableData, encoding: .utf8)?.split(separator: "\t") else {
return
}
Expand All @@ -678,9 +676,9 @@ final public class RealmServer: NSObject, Sendable {
} else if part.contains("ERROR") {
parts.append("🔴")
} else if let json = try? JSONSerialization.jsonObject(with: part.data(using: .utf8)!) {
parts.append(String(decoding: try! JSONSerialization.data(withJSONObject: json,
options: .prettyPrinted),
as: UTF8.self))
try! parts.append(String(data: JSONSerialization.data(withJSONObject: json,
options: .prettyPrinted),
encoding: .utf8)!)
} else if !part.isEmpty {
parts.append(String(part))
}
Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/Impl/SchemaDiscovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private func getLegacyProperties(_ object: ObjectBase, _ cls: ObjectBase.Type) -
if class_getProperty(cls, label) != nil {
throwRealmException("Property \(cls).\(label) is declared as \(type(of: prop.value)), which is not a supported managed Object property type. If it is not supposed to be a managed property, either add it to `ignoredProperties()` or do not declare it as `@objc dynamic`. See https://www.mongodb.com/docs/realm-sdks/swift/latest/Classes/Object.html for more information.")
}
if prop.value as? RealmOptionalProtocol != nil {
if prop.value is RealmOptionalProtocol {
throwRealmException("Property \(cls).\(label) has unsupported RealmOptional type \(type(of: prop.value)). Extending RealmOptionalType with custom types is not currently supported. ")
}
return nil
Expand Down
1 change: 1 addition & 0 deletions RealmSwift/ObjectId.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public final class ObjectId: RLMObjectId, Decodable, @unchecked Sendable {
///
/// Aborts if the string is not 24 characters or contains any characters other than 0-9a-fA-F. Use the initializer which takes a String to handle invalid strings at runtime.
public required init(_ str: StaticString) {
// swiftlint:disable:next optional_data_string_conversion
try! super.init(string: str.withUTF8Buffer { String(decoding: $0, as: UTF8.self) })
}

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/Realm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ extension Realm {
@discardableResult
@_unsafeInheritExecutor
public func asyncRefresh() async -> Bool {
guard rlmRealm.actor as? Actor != nil else {
guard rlmRealm.actor is Actor else {
fatalError("asyncRefresh() can only be called on main thread or actor-isolated Realms")
}
guard let task = RLMRealmRefreshAsync(rlmRealm) else {
Expand Down
7 changes: 2 additions & 5 deletions RealmSwift/Tests/CodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ class CodableTests: TestCase, @unchecked Sendable {
func encode<T: RealmOptionalType & Codable & _RealmSchemaDiscoverable>(_ value: T?) -> String {
let opt = RealmOptional<T>()
opt.value = value
return try! String(decoding: encoder.encode([opt]), as: UTF8.self)
return try! String(data: encoder.encode([opt]), encoding: .utf8)!
}
func encode<T: Codable>(_ value: T?) -> String {
return try! String(decoding: encoder.encode([value]), as: UTF8.self)
return try! String(data: encoder.encode([value]), encoding: .utf8)!
}

func legacyObjectString(_ nullRealmProperty: Bool = false) -> String {
Expand Down Expand Up @@ -1535,7 +1535,6 @@ class CodableTests: TestCase, @unchecked Sendable {
// Verify that it encodes to exactly the original string (which requires
// that the original string be formatted how JSONEncoder formats things)
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
// swiftlint:disable:next non_optional_string_data_conversion
let actual = try XCTUnwrap(String(data: encoder.encode(obj), encoding: .utf8))
XCTAssertEqual(str, actual)

Expand Down Expand Up @@ -2221,7 +2220,6 @@ class CodableTests: TestCase, @unchecked Sendable {
// Verify that it encodes to exactly the original string (which requires
// that the original string be formatted how JSONEncoder formats things)
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
// swiftlint:disable:next non_optional_string_data_conversion
let actual = try String(data: encoder.encode(obj), encoding: .utf8)
XCTAssertEqual(str, actual)
}
Expand Down Expand Up @@ -2431,7 +2429,6 @@ class CodableTests: TestCase, @unchecked Sendable {
obj.objectId = ObjectId("1234567890abcdef12345678")
obj.uuid = UUID(uuidString: "00000000-0000-0000-0000-000000000000")!
obj.date = Date(timeIntervalSince1970: 0)
// swiftlint:disable:next non_optional_string_data_conversion
let actual = try XCTUnwrap(String(data: encoder.encode(obj), encoding: .utf8))
// Before the 2024 OS versions, int8 was sorted before int16
let expected = if #available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, *) {
Expand Down
2 changes: 0 additions & 2 deletions RealmSwift/Tests/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ public func assertPreconditionFailure<T>(_ message: String, _ expression: () asy
guard let data = try pipe.fileHandleForReading.readToEnd() else {
return XCTFail("Expected child process to crash with message \"\(message)\", but it exited without printing anything", file: file, line: line)
}
// swiftlint:disable:next non_optional_string_data_conversion
guard let str = String(data: data, encoding: .utf8) else {
return XCTFail("Expected child process to crash with message \"\(message)\", but it did not print valid utf-8", file: file, line: line)
}
Expand Down Expand Up @@ -349,7 +348,6 @@ public func assertPreconditionFailure<T: Sendable>(
guard let data = try pipe.fileHandleForReading.readToEnd() else {
return XCTFail("Expected child process to crash with message \"\(message)\", but it exited without printing anything", file: file, line: line)
}
// swiftlint:disable:next non_optional_string_data_conversion
guard let str = String(data: data, encoding: .utf8) else {
return XCTFail("Expected child process to crash with message \"\(message)\", but it did not print valid utf-8", file: file, line: line)
}
Expand Down
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=10.53.1
REALM_CORE_VERSION=v14.12.1
REALM_CORE_VERSION=v14.13.0
STITCH_VERSION=c794ec6e2b751ef0cb5ab35256b07f5fa0c74c3a
2 changes: 1 addition & 1 deletion scripts/pr-ci-matrix.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
XCODE_VERSIONS = %w(15.3 15.4 16_Release_Candidate 16.1_beta)
XCODE_VERSIONS = %w(15.3 15.4 16 16.1_beta_2)
DOC_VERSION = '15.4'

all = ->(v) { true }
Expand Down

0 comments on commit 2d07f5c

Please sign in to comment.