diff --git a/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSSmokeTests/main.swift b/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSSmokeTests/main.swift index 32ff291..ca39573 100644 --- a/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSSmokeTests/main.swift +++ b/apps/ios/TeleTuiIOS/Sources/TeleTuiIOSSmokeTests/main.swift @@ -43,10 +43,16 @@ struct TeleTuiIOSSmokeTests { let viewModel = ChatListViewModel(bridge: bridge) await viewModel.load() + precondition(viewModel.folders.map(\.name) == ["All", "Work"]) precondition(viewModel.chats.map(\.title) == ["Saved Messages", "iOS Team"]) viewModel.searchText = "team" precondition(viewModel.filteredChats.map(\.title) == ["iOS Team"]) + + viewModel.searchText = "" + viewModel.selectedFolderId = 2 + await viewModel.load() + precondition(viewModel.chats.map(\.title) == ["iOS Team"]) } @MainActor @@ -126,6 +132,10 @@ struct TeleTuiIOSSmokeTests { let player = RecordingVoicePlayer() let mediaViewModel = MediaViewModel(cache: cache, voicePlayer: player) + mediaViewModel.showPhoto(path: "/tmp/photo.jpg") + mediaViewModel.showVoice(path: "/tmp/voice.ogg") + precondition(mediaViewModel.activePhotoPath == "/tmp/photo.jpg") + precondition(mediaViewModel.activeVoicePath == "/tmp/voice.ogg") let voiceURL = cache.voicePath(fileId: 20) await mediaViewModel.playVoice(url: voiceURL) precondition(mediaViewModel.isVoicePlaying) diff --git a/crates/tele-ios-ffi/README.md b/crates/tele-ios-ffi/README.md index dfe8b93..0a15ba3 100644 --- a/crates/tele-ios-ffi/README.md +++ b/crates/tele-ios-ffi/README.md @@ -23,3 +23,4 @@ Current linking status: - Xcode is installed at `/Applications/Xcode.app`, and `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild -version` reports Xcode 26.5. - The iOS 26.5 simulator runtime is installed and `scripts/check-ios-prereqs.sh` passes with available iPhone/iPad simulators. - The current app shell uses the fake Swift bridge. Real TDLib iOS simulator/device linking is still pending until TDLib is built for `iphonesimulator` and `iphoneos` and wired into the UniFFI target. +- Run `scripts/check-ios-tdlib-linking.sh` to reproduce the current TDLib iOS blocker documented in `docs/ios/tdlib-linking.md`. diff --git a/docs/ios/release-checklist.md b/docs/ios/release-checklist.md index ca0d5e3..8ae83f6 100644 --- a/docs/ios/release-checklist.md +++ b/docs/ios/release-checklist.md @@ -32,6 +32,9 @@ - `swift build --product TeleTuiIOSApp` - `swift run TeleTuiIOSSmokeTests` - `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/build-ios-simulator-app.sh` +- `DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer scripts/check-ios-tdlib-linking.sh` once TDLib iOS artifacts are available + +`swift test` is not currently a CI gate on this host because the CLI Swift toolchain available to the package does not expose `XCTest` or `Testing`. The deterministic view-model coverage lives in the executable `TeleTuiIOSSmokeTests` target until an Xcode test target is introduced. ## Rollback diff --git a/docs/ios/tdlib-linking.md b/docs/ios/tdlib-linking.md new file mode 100644 index 0000000..e5f724b --- /dev/null +++ b/docs/ios/tdlib-linking.md @@ -0,0 +1,34 @@ +# TDLib iOS Linking Status + +Local toolchain status: + +- Xcode 26.5 is installed at `/Applications/Xcode.app`. +- iOS 26.5 simulator runtime is installed. +- `scripts/check-ios-prereqs.sh` passes. +- `scripts/run-ios-simulator-app.sh` launches the fake-backed SwiftUI shell in iOS Simulator. + +Current real TDLib blocker: + +```bash +DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer cargo build -p tele-ios-ffi --target aarch64-apple-ios-sim --release +``` + +Observed failure: + +```text +[Your OS or architecture may be unsupported.] Failed to download file: Please try using the `pkg-config` or `local-tdlib` features. +404 Not Found +https://github.com/FedericoBruzzone/tdlib-rs/releases/download/v1.2.0/tdlib-1.8.29-ios-aarch64.zip +``` + +Interpretation: + +- Rust, Swift, Xcode, and the iOS simulator runtime are working. +- The fake-backed iOS app shell can be built, installed, launched, and rendered. +- Real TDLib iOS linking is blocked because `tdlib-rs` 1.2.0 does not publish the iOS static library artifact requested by its `download-tdlib` build script. + +Next viable paths: + +1. Build TDLib for `iphoneos` and `iphonesimulator` locally and switch the Rust dependency path to `local-tdlib` or `pkg-config`. +2. Add a fake-only `tele-ios-ffi` build feature that avoids linking TDLib for simulator UI work, while keeping real TDLib behind a separate feature. +3. Replace the `tdlib-rs` packaging path for iOS with a lower-level C ABI/XCFramework if UniFFI plus `tdlib-rs` cannot link cleanly on device. diff --git a/scripts/check-ios-tdlib-linking.sh b/scripts/check-ios-tdlib-linking.sh new file mode 100755 index 0000000..2161107 --- /dev/null +++ b/scripts/check-ios-tdlib-linking.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ -z "${DEVELOPER_DIR:-}" && -d /Applications/Xcode.app/Contents/Developer ]]; then + export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer +fi + +target="${IOS_RUST_TARGET:-aarch64-apple-ios-sim}" + +if ! rustup target list --installed | grep -qx "${target}"; then + rustup target add "${target}" +fi + +cargo build -p tele-ios-ffi --target "${target}" --release