You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
report succeeded, skipped, failed, and total counts after Google contact sync
add per-contact debug context using only the one-based batch index and field-presence booleans
represent known contact failures with typed ContactInterfaceError codes
accept only the fixed CONTACT_ERROR_CODES allow-list in logs; collapse all arbitrary messages and unrecognized codes to unknown-error
add focused privacy and result-formatting tests
Why
Issue #677 asks for enough detail to understand partial Google contact imports. The previous implementation tracked only whether any contact failed and logged the raw exception message. That made the final warning difficult to act on and could expose contact or provider data.
Implementation
The final sync summary distinguishes contacts that were saved, skipped because Google supplied no name record, or failed during avatar loading or persistence. Failure debug context contains only:
the contact's one-based position in the fetched batch
booleans describing whether supported fields were present
a stable failure reason from the typed contact-error allow-list, or unknown-error
It does not log names, phone numbers, email addresses, avatar URLs, Google resource identifiers, provider payloads, arbitrary exception messages, or merely string-shaped error codes.
The tests cover aggregate formatting, present and empty field context, every allow-listed contact error, rejection of arbitrary codes, and suppression of provider/contact values and exception text.
No live Google OAuth/contact import was performed, so validation is limited to the focused automated coverage.
Passed:npm run test:contact-sync-logging --workspace @bluebubbles/server
Result: 4/4 focused tests passed.
Coverage includes aggregate result formatting, field-presence context, empty-field handling, stable known reasons, and suppression of provider values and arbitrary exception text.
No live Google OAuth/import workflow was performed, so this records the focused automated coverage only.
Superseding the earlier validation note: the final head uses typed ContactInterfaceError values and accepts only the fixed CONTACT_ERROR_CODES allow-list; arbitrary messages and unrecognized or merely string-shaped codes become unknown-error. The focused suite passes 4/4 and covers result totals, privacy-safe field-presence context, every known code, and suppression of provider/contact values. Limitation: no live Google OAuth/contact import was performed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ContactInterfaceErrorcodesCONTACT_ERROR_CODESallow-list in logs; collapse all arbitrary messages and unrecognized codes tounknown-errorWhy
Issue #677 asks for enough detail to understand partial Google contact imports. The previous implementation tracked only whether any contact failed and logged the raw exception message. That made the final warning difficult to act on and could expose contact or provider data.
Implementation
The final sync summary distinguishes contacts that were saved, skipped because Google supplied no name record, or failed during avatar loading or persistence. Failure debug context contains only:
unknown-errorIt does not log names, phone numbers, email addresses, avatar URLs, Google resource identifiers, provider payloads, arbitrary exception messages, or merely string-shaped error codes.
Validation
Passed on the current head:
node --test test/contactSyncLogging.test.cjs— 4/4 testsgit diff --checkThe tests cover aggregate formatting, present and empty field context, every allow-listed contact error, rejection of arbitrary codes, and suppression of provider/contact values and exception text.
No live Google OAuth/contact import was performed, so validation is limited to the focused automated coverage.
Fixes #677