Skip to content

Refresh complete Google Contacts directories and resolve SMS names - #181

Draft
tpmeredith wants to merge 1 commit into
MaxGhenis:mainfrom
tpmeredith:fix/complete-google-contact-sync
Draft

tpmeredith wants to merge 1 commit into
MaxGhenis:mainfrom
tpmeredith:fix/complete-google-contact-sync

Conversation

@tpmeredith

Copy link
Copy Markdown
Contributor

Google Messages can return a small contact suggestion batch while OpenMessage reports a healthy connection. Contacts outside that batch remain unavailable in compose, and existing numeric thread names wait for independent conversation updates.

This adds an optional complete-directory source through a Google Contacts MCP server. The daemon follows all pages, checks the reported total, and atomically replaces the directory only after a complete fetch. It refreshes immediately and every five minutes by default, independently of phone connectivity, and exposes separate contact-sync freshness/error status.

  • Preserve every returned phone, email and organization; expose dialable numbers to existing compose/route lookups without creating SMS threads.
  • Resolve blank/numeric SMS names by unambiguous full phone numbers and handle directory renames/deletions. Preserve custom/group titles, message history, participant IDs and read state.
  • Retain the last complete directory on errors. Bound requests and pagination, reject redirects and unsafe plaintext endpoints, and read optional bearer credentials only from a private file.
  • Keep the existing Google Messages suggestion path when no connector is configured. The full-directory worker currently supports legacy read mode; v2-primary integration is explicitly disabled and documented.

The limited request and one-shot cache logic predate the recent transport upgrade. This PR is independent of #179 and does not change the Google Messages dependency.

Validation: go test ./..., go test -race ./..., focused HTTP/directory/pagination/lifecycle regression tests, and 16 relevant Playwright tests passed. A private full-directory rehearsal verified preserved message/conversation counts and SQLite integrity. No private contacts, credentials, local deployment settings or operator artifacts are included.

This branch has not been deployed

No deployments
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