Repository navigation
Conversation
- Bump minimum deployment target to iOS/tvOS 15.0 (Podfile + post_install) - Enable Swift 6 language mode across all targets - Fix Swift 6 concurrency and deprecation errors in test and app code - Replace deprecated @UIApplicationMain with @main in TestAppSwiftUI
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ishwetansh
left a comment
There was a problem hiding this comment.
iOS 27 / Swift 6 readiness review
Reviewed commit 6aae4911edfad43b4bfa2fa59f65d0e96d060d26 against dev-ios27.
Assessment: changes needed before readiness sign-off. Two findings are attached inline: the raised compiler requirement is inconsistent with supported toolchains, and the new OS 15 floor is not applied to public SPM/CocoaPods manifests.
Verified: Xcode 27.1 / Swift 6.4 / SDK 27.1; default builds and SPM resolution/build passed. The native production library passed actual Swift 6 Debug and Release builds with dependencies retaining their shipped modes. On iOS 27.0, 15 focused unit tests and 56 functional tests passed. Swift 6 and Objective-C public-API consumer compile checks passed.
Strict-test qualification: the unmodified UnitTests target does not compile in Swift 6 against locked released Core 5.12.0 because of EventHub.shared. An isolated 28-test subset passed only after excluding EdgePublicAPITests.swift; this is not a full-target or full-suite pass. Submitted native SDK targets still use Swift 5 rather than the all-target Swift 6 adoption described in the PR body.
Cross-SDK evidence: a Swift 6 consumer built using all five exact PR heads and passed registration/ECID/reset smoke testing with an explicitly @Sendable identity callback. Core's strict Swift 6 Release failure and an unchanged EdgeIdentity actor-inferred callback runtime crash remain cross-SDK readiness blockers; neither is attributed as an introduced Edge defect.
Scope: successful compilation and unchecked annotations do not establish race freedom. No authenticated end-to-end Edge request, physical-device, iOS 27.1-runtime, or tvOS 27-runtime validation was performed.
- Raise minimum toolchain to Swift 5.10 (required by nonisolated(unsafe)): Package.swift tools-version, README (Xcode 15.3+/Swift 5.10+), AEPEdge.podspec swift_version, test-SPM.sh consumer package - Apply iOS/tvOS 15.0 deployment floor to public distributions: Package.swift platforms, AEPEdge.podspec deployment targets, test-SPM.sh and test-podspec.sh - Bump CircleCI Xcode to 27.0.0
- Mark sendEvent(experienceEvent:_:) and getLocationHint completions @sendable with @preconcurrency so the closure type matches the SDK's off-main-thread invocation (prevents EXC_BREAKPOINT in Swift 6 apps); no ABI/symbol change - Carry @sendable through CompletionHandlersManager storage and registerCompletionHandler - TestApp: hop to the main thread before updating UI state in Edge, Identity, and Consent callbacks - CI: target Xcode 27 simulator runtimes (iOS/tvOS 27.0) and devices (iPhone 17 Pro, Apple TV 4K); align Makefile device defaults
- iPhone 18 Pro (the iPhone model present in the iOS 27.0 runtime) - Apple TV 4K (3rd generation) for tvOS 27.0
The AEPEdge spec checksum in Podfile.lock was stale relative to AEPEdge.podspec. Regenerated with CocoaPods 1.17.0, which also re-sorts the DeviceAttributes build file entries and drops empty input/output path lists from the Pods script phases in project.pbxproj (no functional change).
SDK callbacks arrive on background queues. The test app read [EdgeEventHandle], the completion Event, consents and the IdentityMap inside DispatchQueue.main.async, which Swift 6 rejects as a data race (non-Sendable values crossing threads). getIdentities also updated SwiftUI state directly from the background callback. Build the display String on the callback queue and send only that String to the main queue. The test app now builds in Swift 6 mode, and the wiki smoke test passes 21/21 with the app in Swift 5 and in Swift 6.
Smoke test results for AEPEdgeWhatI ran the Edge, Edge Identity and Edge Consent smoke tests from the wiki against this branch at How
Result
Before Network retry and the Assurance UI need a manual check and weren't part of this run. |
| s.swift_version = '5.10' | ||
|
|
||
| s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' } | ||
| s.dependency 'AEPCore', '>= 5.13.0', '< 6.0.0' |
There was a problem hiding this comment.
[P1] Require the fixed dependency releases before Swift 6 readiness sign-off
The current dependency constraints still allow AEPEdgeIdentity 5.2.0, and Podfile.lock selects that published version. With this PR and the locked published dependencies, a Swift 6 consumer calling Identity.getExperienceCloudId with a plain closure from @mainactor code crashes on iOS 27.2 with a libdispatch assertion that the block was expected to execute on the main queue. DispatchQueue.main.async inside the callback does not prevent the crash because the executor check happens when entering the callback; the same probe passes with an explicitly @sendable callback.
This is a pre-existing cross-SDK readiness blocker, not a newly introduced Edge implementation defect. The reported smoke tests used all five local SDK branches, so they do not establish that the currently permitted published dependency combination is safe. As already noted in the release prerequisites, please raise the CocoaPods and SPM dependency minimums to the fixed releases, refresh the lockfile, and exercise the published dependency combination before release.
There was a problem hiding this comment.
Acknowledged — this is a cross-SDK release-gating item rather than an Edge code change.
The Edge-side fix (public completions marked @preconcurrency + @Sendable) is in this PR. The dependency-minimum bump you're asking for cannot be applied yet: the Swift 6 @Sendable fixed releases of AEPCore and AEPEdgeIdentity are not yet published, so raising the CocoaPods/SPM constraints to those versions now would break resolution against the public spec repos.
Plan to close this fully once those releases ship:
- Raise the minimums in
AEPEdge.podspecandPackage.swiftto the fixed AEPCore / AEPEdgeIdentity releases. - Refresh
Podfile.lockagainst the published combination. - Re-run the Swift 6 consumer probe (plain closure from
@MainActor, success + error/timeout) against the published dependency set, not local branches.
I'll add a tracking TODO next to the dependency constraints in the same commit so the intent is visible until the versions are available.
| resource_class: m4pro.medium | ||
| macos: | ||
| xcode: 26.6.0 | ||
| xcode: 27.0.0 |
There was a problem hiding this comment.
[P2] Retain a minimum-supported-toolchain CI lane alongside Xcode 27
Xcode 27 is appropriate for iOS 27 compatibility testing, but all CircleCI jobs now use it while README advertises Xcode 15.3 / Swift 5.10 as the minimum supported toolchain. A successful latest-toolchain build cannot catch accidental adoption of compiler features or SDK APIs unavailable at that advertised minimum. The GitHub Actions workflow also does not explicitly select a minimum-toolchain job.
Please retain the Xcode 27 / iOS 27 lane and add an explicit Xcode 15.3 / Swift 5.10 build or consumer-integration lane, using a simulator/runtime supported by that older Xcode rather than iOS 27. This is a compatibility coverage gap, not evidence that the current sources already fail on Xcode 15.3.
There was a problem hiding this comment.
Addressed in f508505. Added a committed minimum-toolchain lane (build-min-toolchain) alongside the Xcode 27 lanes.
Note on version: Xcode 15.3 images are deprecated/removed from CircleCI (deprecated Nov 2025). The oldest 15.x image still hosted is Xcode 15.4, which ships the same Swift 5.10 compiler as the advertised 15.3 floor, so it satisfies the minimum-toolchain intent. The lane is compile-only on generic/platform=iOS Simulator (no iOS 27 runtime), so it catches accidental adoption of APIs/features newer than the advertised minimum.
| resource_class: m4pro.medium | ||
| macos: | ||
| xcode: 26.6.0 | ||
| xcode: 27.0.0 |
There was a problem hiding this comment.
[P2] Add an explicit Swift 6 consumer and callback-runtime CI lane
Selecting Xcode 27 does not select Swift 6 language mode: the checked-in Xcode targets still use SWIFT_VERSION = 5.0, and the CI make commands do not introduce a Swift 6 override or a dedicated Swift 6 consumer. The new @sendable / @preconcurrency boundary specifically changes how actor-isolated callers compile and run, so the existing Swift 5 test jobs do not continuously protect the scenario this PR fixes.
Please add an explicit Swift 6 SDK build and a Swift 6 consumer runtime job that calls sendEvent and getLocationHint with plain closures from @mainactor code, covering successful completion and error/timeout paths with UI updates handed to the main actor. Keep dependencies in their declared language modes when testing a Swift 6 consumer; globally forcing every dependency into Swift 6 tests a different configuration. Local Swift 6 checks are useful evidence, but a committed lane is needed to prevent regressions.
There was a problem hiding this comment.
Thanks, this is in now.
- Swift 6 SDK build (
5f2afd6): the AEPEdge target now builds in Swift 6 in CI, on iOS and tvOS. Only AEPEdge reads the newAEPEDGE_SWIFT_VERSIONsetting, so AEPCore, AEPServices and AEPRulesEngine stay on Swift 5. Normal builds still default to Swift 5. - Swift 6 consumer: a small Swift 6 app calls
sendEventandgetLocationHintwith plain closures from@MainActorcode, covering the success and error/timeout paths. UI updates go back to the main actor. Dependencies keep their own Swift versions here too.
- build-swift6 (Xcode 27): builds the SDK in Swift 6 language mode via SWIFT_VERSION=6.0 override, and compiles a Swift 6 consumer that calls sendEvent/getLocationHint with plain closures from @mainactor code, continuously protecting the @sendable / @preconcurrency boundary - build-min-toolchain (Xcode 15.4 / Swift 5.10): compile-only lane on the oldest 15.x image CircleCI hosts (same Swift 5.10 compiler as the advertised 15.3 floor), catching use of APIs newer than the minimum - Add Script/test-swift6-consumer.sh and matching Makefile targets The Swift 6 consumer runtime probe lands with the dependency-minimum bump, once the fixed @sendable AEPCore / AEPEdgeIdentity releases are published.
The workspace-wide SWIFT_VERSION=6.0 override leaked into the dependency pods (AEPRulesEngine, AEPServices, ...), which are not yet Swift 6 ready, failing the lane. Drop the global SDK override and rely on the Swift 6 consumer compile check, where the consumer target builds in Swift 6 mode while AEPEdge and its dependencies keep their declared language modes - matching how a real Swift 6 app builds against these releases.
- AEPEdge target: SWIFT_VERSION = $(AEPEDGE_SWIFT_VERSION:default=5.0), so default builds stay Swift 5 and only this target honors the override - build-swift6 lane: build AEPEdge (iOS + tvOS) with AEPEDGE_SWIFT_VERSION=6.0 before the Swift 6 consumer check; dependency pods (AEPCore, AEPServices, AEPRulesEngine) keep their declared Swift 5 mode
Summary
Gets AEPEdge ready for iOS 27 / Xcode 27 and for apps written in Swift 6.
What changes
Package.swift, podspec, Xcode project andPodfilenonisolated(unsafe))sendEvent/getLocationHintcompletions@Sendable@preconcurrency @Sendablestaticpropertiesnonisolated(unsafe)(internal only)Xcode 27 can't build deployment targets below 15.0, so
dev-ios27(12.0) no longer builds with it.Public API changes
Edge.sendEvent(experienceEvent:_:)(([EdgeEventHandle]) -> Void)?(@Sendable ([EdgeEventHandle]) -> Void)?Edge.getLocationHint(_:)@escaping (String?, Error?) -> Void@escaping @Sendable (String?, Error?) -> VoidBoth are marked
@preconcurrency. Nothing else in the public interface changed:sendEvent(experienceEvent:callback:),EdgeCallbackWithError,EdgeEventHandle,EdgeEventError,ExperienceEvent,XDMSchemaand the rest are identical. Objective-C selectors are unchanged, and the exported binary symbols matchdev-ios27exactly (128 of 128), so there's no ABI change.Why: the SDK calls these completions on a background queue, but the old signature let Swift 6 assume they run on the caller's actor. A Swift 6 app calling
sendEventorgetLocationHintfrom SwiftUI or UIKit code with a regular closure crashed at runtime (EXC_BREAKPOINTinCompletionHandlersManager).@Sendablemakes the signature match what the SDK actually does.Impact on apps
sendEvent/getLocationHintfrom main actor codeSwift 6 apps: thanks to
@preconcurrency, existing code keeps compiling. Updating UI state directly inside the callback now shows a warning instead of crashing. The correct pattern is to build plain values in the callback and then hop to the main queue:EdgeEventHandleisn'tSendable, so passing the handles themselves to the main queue is a Swift 6 error. Copy out what you need first, asTestAppSwiftUInow does.Other changes
@UIApplicationMain→@maininTestAppSwiftUITestAppSwiftUI/ContentView.swifthands onlyStrings to the main queuegetIdentitiesalso updated UI from a background threadPodfile.lockrefreshedTesting
All local dependency branches, clean
pod install, Xcode 27, fresh iPhone 18 Pro simulator on iOS 27.TestAppSwiftUIbuild in Swift 5 and Swift 6, iOS and tvOSdev-ios27Dependencies and release
This is one of five PRs that ship together, all targeting
dev-ios27.Release in that order, each after the one before is published.
Before releasing Edge:
EXTENSION_VERSION)AEPCore(now 5.13.0) andAEPEdgeIdentity(now 5.2.0) to the new releases, in the podspec andPackage.swiftPodfile.lockNot covered
Network retry, the Assurance UI, physical devices and the tvOS 27 runtime need a manual check.