Repository navigation
test: cover profile tags after restore refresh - #1370
Conversation
[Low impact] This PR appears safe to merge; no actionable issues were found. SummaryAdds a regression test that checks saved profile tags after a failed restore read and a successful refresh.
No actionable issues found. Tests were not run during this review. Reviews (1) · Last reviewed commit: "test: cover profile tags after restore r..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Adds ProfileIO injection to PubkyAppProfileStore and a regression test: a failed Paykit read, a successful refresh, then a save of the original form publishes the stored tags plus the new one. Reviewed 2bd3e4d, full tier.
What I checked, and 3 candidates I ruled out
Read in full: PubkyAppProfileStore.swift (load, save, storedCopy, publishCopy, identity/isSignedIn), the new test and stub.
Not built: iOS does not build on this Linux reviewer, so this review is reasoned from the code and from CI. build-local, SwiftFormat and validate are green; Run Tests and Run Integration Tests were still pending when I read the checks.
Ruled out
- Behaviour change from the static to instance move of
identity/isSignedIn: both only swapPubkyService.currentPublicKey()forprofileIO.currentPublicKey, whose.livevalue is the same call;shareduses.live. - Paths still calling
PubkyServicedirectly (migrate,moveAvatar,deleteProfile,uploadAvatar): unchanged from master and not reached by the test, since the stubbed pubky.app profile exists and no avatar is pending. - Test leaking
UserDefaultsstate: the owners and pending-avatar keys are saved and restored indefer; the save inserts the key into owners, which the restore undoes.
Merge confidence: 4/5, no findings, but the unit run in CI was still pending and the change was not built here.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to this reviewer does not report it)
There was a problem hiding this comment.
Verdict: ✅ Approve
Findings: None.
QA for 2bd3e4d:
Save restored profile tags after a failed read and successful refresh ✅ The regression passed; XCTest verified that the original form publishes `["friend", "work", "vip"]`.
Ran PubkyAppProfileStoreTests.testSavingOriginalRestoreFormAfterRefreshPublishesExistingAndNewTags against the real store and Paykit serialization with the injected service stub. The recording shows the simulator test run; the payload is checked by the XCTest assertion.
restore-tags-2x.2x.mp4
Simulator test run at 2× speed.
Run the automated suite with the profile service injection ✅ The unit workflow's test selection passed with zero failures.
Built the unchanged head with Xcode 27.0 and ran on an iPhone 17 Pro simulator with iOS 27.0. XCTest reported 4,133 unit tests and 8 UI tests passed, with 9 existing optional fixture tests skipped. The new regression passed within the suite too. Used the unit workflow's integration-test exclusions. SwiftFormat 0.64.6 on both changed files and git diff --check passed.
unit-suite-2x.small.mp4
Automated suite at 2× speed; outcomes verified from XCTest results.
No manual journey is listed or needed for this test-only change. Live homeserver persistence was not exercised. The existing fixture-dependent skips do not cover the changed profile-store path.
Full review of 0c75667..2bd3e4d, including the service forwarding, identity checks, tag serialization, callers and test isolation. The live callbacks retain the existing service arguments and identity guards. The earlier static review also found no issues.
Android counterpart: bitkit-android#1884 fix: preserve tags when restoring a profile covers the same restore-tag preservation. This PR adds the missing iOS store-boundary assertion.
Reviewed by gpt-6.1-sol-high
|
@piotr-iohk Merged, as it was approved and green. |
Closes #1307
This PR adds an iOS regression test for saving a restored profile after its first Paykit copy read fails. It verifies that the save publishes the tags already stored in Paykit together with the tag added in the original form.
Description
Design
N/A. This change adds automated coverage at the profile store.
Preview
N/A
QA Notes
Setup
Run the
Bitkitscheme on an iOS simulator. The test uses an in-memory service stub.Journeys
N/A for this test coverage change.
Manual Tests
N/A
Automated Checks
PubkyAppProfileStoreTests.swift— verifies that saving the original restore form publishes both the existing tags and the new tag after a failed read and a successful refresh.Evidence
2bd3e4dwas tested on an iPhone 17 simulator running iOS 26.0 with Xcode 26.0.1. The captured Paykit payload contained["friend", "work", "vip"].BitkitTestssuite finished with 4,133 passed, 5 skipped, and 0 failures, using the unit workflow's integration-test exclusions. SwiftFormat 0.64.6 andgit diff --checkpassed.SparkExitSweepTests.swift. The passing run split that expression into equivalent steps, then restored the file.Gaps
The regression verifies the outgoing payload at the Paykit service boundary. A live homeserver is outside the scope of this test.
Models used
gpt-6.1-sol(reasoning:high),gpt-6.2-sol(reasoning:high)gpt-6.2-sol(reasoning:high)gpt-6.2-sol(reasoning:high)