feat(ios): show app and environment versions - #5790
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1a884f1 to
96b9e47
Compare
96b9e47 to
106e970
Compare
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. You can customize Macroscope's approvability policy. Learn more. |
4cb3307 to
497f54f
Compare
|
Rebuilt this feature as one clean commit on the current Theo SwiftUI base. It now shows separate app and environment version rows, prefers the live server-config version over stale pairing metadata, preserves that value across partial config updates, and leaves one shared formatter for the changelog PR to reuse. Verification: 5 focused tests and all 227 native tests passed; final direct Claude Opus 5 high review exited 0 with no actionable findings. GitHub CI is rerunning on the refreshed head. |
106e970 to
dfbd649
Compare
Dismissing prior approval to re-evaluate dfbd649
dfbd649 to
1ed616d
Compare
Dismissing prior approval to re-evaluate 1ed616d
|
|
||
| private func mapEnvironment(_ environment: Environment, activeID: String?) -> FeatureEnvironment { | ||
| FeatureEnvironment( | ||
| let serverVersion = serverConfigsByEnvironmentID[environment.id]? |
There was a problem hiding this comment.
🟡 Medium App/NativeFeatureClient.swift:3828
mapEnvironment reads serverVersion only from serverConfigsByEnvironmentID[environment.id]?.environment?.serverVersion and never falls back to environment.descriptor?.serverVersion. When the server config is not yet cached (or lacks an embedded environment snapshot), the returned FeatureEnvironment.serverVersion is nil even though the persisted descriptor has a valid version, so a connected environment is shown with an unknown version. Consider coalescing the config value with environment.descriptor?.serverVersion.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/swift-ios/App/NativeFeatureClient.swift around line 3828:
`mapEnvironment` reads `serverVersion` only from `serverConfigsByEnvironmentID[environment.id]?.environment?.serverVersion` and never falls back to `environment.descriptor?.serverVersion`. When the server config is not yet cached (or lacks an embedded environment snapshot), the returned `FeatureEnvironment.serverVersion` is `nil` even though the persisted descriptor has a valid version, so a connected environment is shown with an unknown version. Consider coalescing the config value with `environment.descriptor?.serverVersion`.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1ed616d. Configure here.
| private func mapEnvironment(_ environment: Environment, activeID: String?) -> FeatureEnvironment { | ||
| FeatureEnvironment( | ||
| let serverVersion = serverConfigsByEnvironmentID[environment.id]? | ||
| .environment?.serverVersion |
There was a problem hiding this comment.
Paired version fallback left unwired
Medium Severity
mapEnvironment only reads serverConfigsByEnvironmentID’s live environment?.serverVersion and never calls serverVersion(fallingBackTo:), so the persisted pairing descriptor is ignored. Connected environments can show no server version when config is missing, soft-decoded away, or not yet merged, even though pairing metadata already has a version.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1ed616d. Configure here.
|
Exact final-head simulator proof (1ed616d): Settings renders the app name, version/build, and platform cleanly at phone width. The disconnected environment fallback is visible in Connections; connected server-version behavior remains covered by focused metadata tests. Focused version/core tests passed (16 total). The current native-CI red is the base-branch provider-catalog fixture failure fixed separately in #6130. |



What changed
Not connectedandUnknownfallbacks.FeatureEnvironmentsnapshot.This is the narrow display-only version of the idea. It does not implement source comparison or changelog links, refresh descriptors, add network or persistence lifecycles, change Info.plist, or modify install scripts. It should not be treated as closing a broader source-comparison proposal without maintainer agreement.
Base:
pingdotgg/t3code:t3code/rebuild-mobile-app-swiftate55c7ffd1.Reviewed head:
106e970770f2c875c32ddc02d148f37ae984591d.Why
The two versions make client/server mismatch reports diagnosable from one screen using data the app already has.
UI evidence
Exact rebased head, paired to a disposable loopback environment:
The screen shows app version
0.1.0 (19)and the active environment descriptor version.Verification
T3CodeTests/SettingsVersionMetadataTests: 2 focused tests passed.0.1.0 (19)and the paired environment version.git diff --check: passed; rebase preserved the feature patch exactly.Checklist
Built with GPT-5.6 Sol in the Codex harness.
Note
Low Risk
Display-only UI and optional decoding of existing server config fields; no auth, networking, or persistence lifecycle changes.
Overview
Surfaces client and server version strings in native Settings so mismatch reports are easier to diagnose from the app, using data the client already receives.
ServerConfigSnapshotnow decodes and retains an optionalenvironmentdescriptor (with lossy handling for malformed payloads) and exposesserverVersion(fallingBackTo:).NativeFeatureClientkeeps that descriptor when rebuilding config from provider or settings stream events, andFeatureEnvironmentcarriesserverVersioninto feature snapshots.Settings → About adds an App version row via new
SettingsAboutMetadataformatting (bundle version/build, ignoring Xcode placeholders). Connections shows Server {version} only while the environment is connected, hiding stale values when disconnected or reconnecting.Contract and formatting behavior are covered by updated
CoreContractTestsand newSettingsAboutMetadataTests.Reviewed by Cursor Bugbot for commit 1ed616d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Show app version in Settings and server version per connected environment on iOS
SettingsAboutMetadata.appVersionLabelutility that readsCFBundleShortVersionStringandCFBundleVersionfrom the main bundle.serverVersionis available.ServerConfigSnapshotwith an optionalEnvironmentDescriptorfield and aserverVersion(fallingBackTo:)helper;FeatureEnvironmentgains an optionalserverVersionproperty propagated from the server config.Macroscope summarized 1ed616d.