Repository navigation
fix: preserve tags when restoring a profile - #1303
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryPreserves the restore form’s original unread-tags flag through identity creation.
Reviews (1) · Last reviewed commit: "fix: preserve tags when restoring a prof..." · Reviewed by Greptile |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Passes the restore form's own unread-tags flag from CreateProfileView into createIdentity, so a restore save still merges the stored Paykit tags after a later load cleared tagsUnavailable. Reviewed 1f32d37, light tier, static (iOS does not build on this reviewer's Linux host; CI covers the build).
What I checked, and 3 candidates I ruled out
Read in full: createIdentity, createProfile, writeProfile in PubkyProfileManager.swift; load and save in PubkyAppProfileStore.swift; loadInitialData and remoteProfile in CreateProfileView.swift
Call sites traced: every createIdentity( caller (only CreateProfileView), every baseTagsUnread: caller (EditProfileView, ProfileView already passed it)
CI: SwiftFormat, validate and integration tests green; Run Tests still running at review time
Ruled out
- The bug before the fix:
savecomputedcopyUnread = data.baseTagsUnread || tagsUnavailable.contains(key); a successful refresh removes the key, sostoredCopyreturned(nil, nil)andtags(data.tags, keeping: nil)wrote the form's empty list. With the flag carried,storedCopyre-reads the copy andtags(_:keeping:)keeps it. - Signed-out restore path:
remoteProfilefalls back tofetchRemoteProfile, whose profile never setstagsUnread, so it passesfalseas before; unchanged behaviour, not this diff. - Copy still unreadable at save:
storedCopyreturns nil,tagsstays nil, and the profile is stored withtagsUnreadkept true, so nothing is overwritten.
Merge confidence: 4/5, the unit-test job was still running when this was posted; the new test covers the change.
|
Triage: milestone 3.2.0, as its Android twin synonymdev/bitkit-android#1884. This PR fixes the pubky.app profile restore on master and closes no issue, so it carries the milestone itself. Cherry-picking it into 3.1.1 stays your call. |
jvsena42
left a comment
There was a problem hiding this comment.
No findings.
CreateProfileViewpasses the snapshot'stagsUnread(existingProfileis@State, set once inloadInitialData, so a manager refresh can't change it) throughPubkyProfileManagertoprofileData.baseTagsUnread.PubkyAppProfileStore.savethen re-reads the stored copy and unions the tags.- If the copy is unreadable at save, nothing is written and the stored profile keeps
tagsUnread = true. That is stricter than Android, which doesn't re-arm the flag in that case. - Everything is keyed by the normalized public key.
Two notes, neither blocking:
PubkyProfileManagerTests.swift:1317only checks that the flag reaches the publisher. No test runsPubkyAppProfileStore.savewithbaseTagsUnread, while the Android twin synonymdev/bitkit-android#1884 covers it end to end.- The same changelog point as on Android applies if iOS
release-3.1.1carries this fix.
Device gate: no device check needed: no UI change, and the state needs fault injection. perf: one conditional extra read. CI: 8 pass, 1 pending.
Reviewer model: Claude Fable 5.2 (claude-fable-5-2), Claude Opus 5.5 (claude-opus-5-5)
Reasoning effort: not exposed
|
Following up on the approval notes.
|
Twin: synonymdev/bitkit-android#1884
Description
The restore form can open when the pubky.app profile is available and its Paykit copy cannot be read. A refresh can recover the stored tags while the open form still holds an empty list. Preserve the form’s original unread-tags flag through identity creation so the save keeps those stored tags. Finding on the 3.1.1 release PR
Out of Scope
QA Notes
Setup
Run
PubkyProfileManagerTests.testCreateIdentityPreservesUnreadTagsFromTheRestoreFormAfterRefreshin theBitkitscheme. It uses an injected profile reader and publisher on an iOS simulator.Automated Checks
PubkyProfileManagerTests.swiftto verify the restore snapshot’s unread flag reaches publication after a successful background refresh.Evidence
The iOS simulator build passed. The unit suite finished with 3,218 passes and one skip, including the new regression. SwiftFormat 0.64.6 passed on all three changed Swift files. Local Xcode 26.0 needed the dependency’s default secp256k1 C modules enabled explicitly.
Models used
GPT-6(reasoning:Not exposed)GPT-6(reasoning:Not exposed)The session exposes the model family. It does not expose the variant or reasoning setting.