Skip to content

test: cover profile tags after restore refresh - #1370

Merged
ovitrif merged 1 commit into
masterfrom
codex/ios-1307-restore-tags
Nov 19, 2026
Merged

ovitrif merged 1 commit into
masterfrom
codex/ios-1307-restore-tags

Conversation

@piotr-iohk

Copy link
Copy Markdown
Collaborator

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

  • Uses the real profile store to load the original form snapshot, refresh it successfully, and submit the original snapshot with a new tag.
  • Injects the profile service calls so the test can control the read failure and capture the serialized Paykit profile passed to the publisher.

Design

N/A. This change adds automated coverage at the profile store.

Preview

N/A

QA Notes

Setup

Run the Bitkit scheme 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

  • added 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

  • The diff in 2bd3e4d was tested on an iPhone 17 simulator running iOS 26.0 with Xcode 26.0.1. The captured Paykit payload contained ["friend", "work", "vip"].
  • The local BitkitTests suite finished with 4,133 passed, 5 skipped, and 0 failures, using the unit workflow's integration-test exclusions. SwiftFormat 0.64.6 and git diff --check passed.
  • Xcode 26.0.1 hit a type-checking limit on a pre-existing expression in 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

  • Planning/scoping: gpt-6.1-sol (reasoning: high), gpt-6.2-sol (reasoning: high)
  • Implementation: gpt-6.2-sol (reasoning: high)
  • Review: gpt-6.2-sol (reasoning: high)

@piotr-iohk piotr-iohk added this to the 3.2.0 milestone Nov 19, 2026
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge; no actionable issues were found.

Summary

Adds a regression test that checks saved profile tags after a failed restore read and a successful refresh.

  • Profile-store tests can simulate a failed Paykit read and check saved tags.

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

@ovitrif ovitrif removed this from the 3.2.0 milestone Nov 19, 2026

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 swap PubkyService.currentPublicKey() for profileIO.currentPublicKey, whose .live value is the same call; shared uses .live.
  • Paths still calling PubkyService directly (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 UserDefaults state: the owners and pending-avatar keys are saved and restored in defer; 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)

@piotr-iohk
piotr-iohk requested review from a team, ben-kaufman and ovitrif and removed request for a team November 19, 2026 12:16

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@piotr-iohk Merged, as it was approved and green.

@ovitrif
ovitrif merged commit 602cd0e into master Nov 19, 2026
22 of 24 checks passed
@ovitrif
ovitrif deleted the codex/ios-1307-restore-tags branch November 19, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: verify that an iOS restore save preserves stored Pubky profile tags

3 participants