Skip to content

fix: wait for contacts before reapplying shared profiles on connect - #10

Merged
GraysonCAdams merged 2 commits into
mainfrom
fix/shared-profile-startup
Nov 27, 2026
Merged

GraysonCAdams merged 2 commits into
mainfrom
fix/shared-profile-startup

Conversation

@GraysonCAdams

Copy link
Copy Markdown
Contributor

On restart, refreshSharedProfilesOnConnect pushed cached shared iMessage profiles to their ghosts before the first CardDAV sync. GetUserInfo prefers a contact, but with the contact cache still empty it fell back to the shared profile, so a contact who shares a different name and photo switched to those and then back a second later, four profile changes in each of their rooms. The push was split off from setContactsReady on purpose so a slow MobileMe delegate retry couldn't hold it up; it now waits on the same readiness gate CloudKit sync uses, which is capped at 30 seconds, so that still holds.

Test plan

  • go test ./pkg/connector/ -run TestWaitForContactsReady
  • Restarted a live bridge: the log shows the wait, the contact sync, then the reapply, and the contact's ghost got no profile change

Grayson Adams added 2 commits November 27, 2026 07:47
On every restart the cached shared iMessage profiles were pushed to their
ghosts before the first CardDAV sync. GetUserInfo prefers a contact, but
with the contact cache still empty it fell back to the shared profile, so
a contact who shares a different name and photo flipped to them and then
back once contacts loaded: four profile changes in each of their rooms.
The log shows the push finishing at 06:08:04.3 and the contact sync at
06:08:05.4.

refreshSharedProfilesOnConnect now waits on the contacts readiness gate,
bounded by the same 30s timeout CloudKit sync uses, so a slow MobileMe
delegate retry still doesn't hold it up for long.
@GraysonCAdams
GraysonCAdams merged commit 3d18e38 into main Nov 27, 2026
4 checks passed
@GraysonCAdams
GraysonCAdams deleted the fix/shared-profile-startup branch November 27, 2026 12:59
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.

1 participant