Skip to content

Fix folder sync for contacts without a public phone number#7741

Open
huzvanec wants to merge 1 commit intosignalapp:mainfrom
huzvanec:fix/folder-sync-contacts-without-e164
Open

Fix folder sync for contacts without a public phone number#7741
huzvanec wants to merge 1 commit intosignalapp:mainfrom
huzvanec:fix/folder-sync-contacts-without-e164

Conversation

@huzvanec
Copy link
Copy Markdown
Contributor

First time contributor checklist:

Contributor checklist:

  • My contribution is not related to translations.
  • My commits are in nice logical chunks with good commit messages
  • My changes are rebased on the latest main branch
  • A pnpm run ready run passes successfully (more about tests here)
  • My changes are ready to be shipped to users

Description

When adding a user without a public phone number to a folder on mobile, the contact did not sync to desktop. The recipientToConversationId function relied on Recipient.contact.serviceId, which is often (always during my testing) undefined.
This led to all contacts falling back to being identified by their phone numbers (e164) and contacts without a public phone number caused an error and didn't get added to the folder.

This PR fixes this by identifying contacts primarily by their serviceIdBinary which is always present.

Tested on Android 16 -> Debian GNU/Linux 13 (trixie) x86_64 (against prod servers).

Example error raised for contacts without public phone numbers:

ERROR 2026-02-28T21:40:29.292Z [storage] merge(121:r5z): error with item type=8 details=Error: mergeChatFolderRecord(121:r5z, idString): Missing conversation for recipient
    at strictAssert ([REDACTED]/resources/app.asar/preload.bundle.js:23:570)
    at recipientToConversationId ([REDACTED]/resources/app.asar/preload.bundle.js:169:176953)
    at [REDACTED]/resources/app.asar/preload.bundle.js:169:177040
    at Array.map (<anonymous>)
    at recipientsToConversationIds ([REDACTED]/resources/app.asar/preload.bundle.js:169:177033)
    at mergeChatFolderRecord ([REDACTED]/resources/app.asar/preload.bundle.js:169:177561)
    at mergeRecord ([REDACTED]/resources/app.asar/preload.bundle.js:169:199496)
    at concurrency ([REDACTED]/resources/app.asar/preload.bundle.js:169:207760)
    at [REDACTED]/resources/app.asar/preload.bundle.js:54:845
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)

Contacts without a public phone number did not sync to desktop
because Recipient.contact.serviceId was missing. Contacts are
now primarily identified using serviceIdBinary.
@jamiebuilds-signal
Copy link
Copy Markdown
Member

Cherry picking this into our next release, thank you

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.

2 participants