Skip to content

Build against upstream mautrix-gmessages v0.2611.0 (fixes Google Account pairing 3/32) - #301

Open
aaymeloglu wants to merge 2 commits into
MaxGhenis:mainfrom
aaymeloglu:upstream-libgm-v0.2611
Open

aaymeloglu wants to merge 2 commits into
MaxGhenis:mainfrom
aaymeloglu:upstream-libgm-v0.2611

Conversation

@aaymeloglu

Copy link
Copy Markdown

Fixes #300.

Google Account pairing fails with unknown error pairing: 3/32 against current Messages builds (reproduced on stable messages.android_20261106). The pinned MaxGhenis/gmessages fork is 116 commits behind mautrix/gmessages. This builds against upstream v0.2611.0 directly. With it, pairing succeeds, and the deep backfill and cookie self-heal work.

Changes

  • go.mod: drop the MaxGhenis/gmessages replace and require go.mau.fi/mautrix-gmessages v0.2611.0. whatsmeow is bumped to match go.mau.fi/util.
  • Context args at every libgm call. The google bridge adapter keeps its context-free seams through a small gmCompat wrapper.
  • NotifyDittoActivity is private upstream. The liveness probe uses an IsBugleDefault round trip instead, which is also answered by the phone.
  • libgm.NewClient now takes exhttp.ClientSettings (20 s response-header timeout, as before). DownloadMedia returns an io.ReadCloser.
  • Removes the fork drift workflow and the fork contract test, and adds a note to the runbook's fork section.

Behavior differences to review

  • Carried patch 2 (payload-less frames) is lost. Upstream doesn't have it. ResponsePayloadError and ErrNoResponsePayload stay as local types in internal/client so the pull-health classification and its tests are unchanged, but upstream never produces them, so a payload-less answer is an empty success again. If you'd rather keep that guard, rebasing the fork's patch 2 onto v0.2611 is the alternative. It conflicts with upstream's ctx refactor, which is why I didn't take that route.
  • Phone request timeout is 60 s (upstream's fixed responseHardTimeout) instead of OpenMessage's 35 s, because upstream removed SetRequestTimeout. That interacts with the outbox's 60 s transport bound described in internal/client/client.go.
  • Patches 1 and 3 are covered upstream: ListConversations takes a request with a Cursor, and upstream has its own hard timeout and cancels waiters on disconnect.

Also included (small, separable)

  • OPENMESSAGE_CHROME_SAFE_STORAGE overrides the keychain item that pair --google-chrome and cookie self-heal read, so other Chromium browsers work (e.g. "Brave Safe Storage"), together with OPENMESSAGE_CHROME_PROFILE.
  • OPENMESSAGES_DISABLE_LOCAL_IMPORT=whatsapp,signal,imessage|all skips the periodic import from local desktop app databases. Documented in the README env table.

Happy to split either of these out.

Testing

  • go test ./... passes (34 packages).
  • The -race suite and Playwright e2e weren't run locally.
  • Live: paired via pair --google-chrome, ran serve --web --mcp-sse, and ran deep backfills. Google cookies expired roughly every 10 min, probably from the browser rotating them, and credential repair recovered each time within about 11 s. Each expiry aborts an in-flight deep backfill, though, so a full history took several passes.

🤖 Generated with Claude Code

aaymeloglu and others added 2 commits November 22, 2026 22:24
…2) (#1)

* WIP: build against upstream mautrix-gmessages v0.2611.0

Drops the MaxGhenis/gmessages replace (116 commits behind upstream; Google
account pairing fails with 'unknown error pairing: 3/32'). Adds context args,
a context-free compat wrapper for the google bridge adapter, and stands in
for fork-only APIs (ListConversationsWithCursor, NotifyDittoActivity,
ResponsePayloadError). Tests still reference fork-only APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnzuTata7q6EnYiknQZhGJ

* googlecookies: allow overriding the keychain Safe Storage service name

Lets --google-chrome read cookies from other Chromium browsers (Aside, Brave)
by setting OPENMESSAGE_CHROME_SAFE_STORAGE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnzuTata7q6EnYiknQZhGJ

* Fix tests for upstream libgm; add OPENMESSAGES_DISABLE_LOCAL_IMPORT

- Keep ResponsePayloadError/ErrNoResponsePayload as local types in
  internal/client (upstream libgm doesn't emit them) so pull-health
  classification and its tests are unchanged.
- Tests: fork-only UnansweredRequestError -> wrapped ErrPhoneNotResponding /
  ErrConnectionClosed; NewClient gets exhttp.ClientSettings; drop the fork
  contract test and the RequestTimeout test.
- serve: OPENMESSAGES_DISABLE_LOCAL_IMPORT=whatsapp,signal,imessage|all skips
  importing from local desktop app databases.

go test ./... passes (34 packages).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnzuTata7q6EnYiknQZhGJ

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The workflow asserted the MaxGhenis/gmessages replace in go.mod, which this
branch removes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnzuTata7q6EnYiknQZhGJ

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.

Google Account pairing fails with 'unknown error pairing: 3/32' (libgm fork 116 commits behind upstream)

1 participant