diff --git a/plans/2026-07-06-fix-directory-name-reapproval.md b/plans/2026-07-06-fix-directory-name-reapproval.md index ec6acda761..8aaefc6c99 100644 --- a/plans/2026-07-06-fix-directory-name-reapproval.md +++ b/plans/2026-07-06-fix-directory-name-reapproval.md @@ -207,7 +207,16 @@ not a directory policy, so it belongs where the comparison lives: `profileChanged` true and stores). `Commands.hs:4358` is the directory path this fix targets. -## 8. Verification (done) +### Related, out of scope (follow-up note) + +The directory's *other* change detector, `deGroupUpdated`'s `sameProfile` +(`Service.hs:548-551`), still compares whole profiles including `publicGroupId`. +It is **not** currently triggerable by staleness — `CEvtGroupUpdated` carries +`fromGroup`/`toGroup` both freshly DB-loaded with the same stored id — so it is +not part of this bug. But there are now two notions of "profile changed" in the +tree; if a future path ever feeds a stale-id group into `deGroupUpdated`, the same +class of bug could reappear there. Flagged for a follow-up; deliberately not +expanded into by this one-line fix. Regression test `testLinkCheckStalePublicGroupId` in `tests/Bots/DirectoryTests.hs` (beside the existing "link/whitespace-only must not re-approve" tests): register + diff --git a/src/Simplex/Chat/Library/Internal.hs b/src/Simplex/Chat/Library/Internal.hs index cc106ff4d4..f43b8a2f29 100644 --- a/src/Simplex/Chat/Library/Internal.hs +++ b/src/Simplex/Chat/Library/Internal.hs @@ -1482,7 +1482,8 @@ updateGroupFromLinkData user gInfo@GroupInfo {groupProfile = p, groupDomainVerif -- publicGroupId is immutable identity, not content, and is not a column -- updateGroupProfile syncs (it is set at group creation / by updateRelayGroupKeys). -- A stale stored value would otherwise make this (/=) re-trigger directory - -- approval on every link check. Normalize it out (mirrors sameGroupProfileInfo). + -- approval on every link check. Normalize it out before comparing (same + -- record-nulling technique as sameGroupProfileInfo, which nulls groupPreferences). profileChanged = clearId p /= clearId groupProfile clearId gp@GroupProfile {publicGroup} = gp {publicGroup = (\pg -> (pg :: PublicGroupProfile) {publicGroupId = B64UrlByteString ""}) <$> publicGroup}