Skip to content

fix: update whatsmeow and fix post-connect chat loading - #135

Open
joivo wants to merge 3 commits into
normen:masterfrom
joivo:fix/client-outdated-whatsmeow-v2
Open

fix: update whatsmeow and fix post-connect chat loading#135
joivo wants to merge 3 commits into
normen:masterfrom
joivo:fix/client-outdated-whatsmeow-v2

Conversation

@joivo

@joivo joivo commented Aug 4, 2026

Copy link
Copy Markdown

Problem

  • WhatsApp rejects old client version with 405 Client Outdated error
  • After fixing the version, the TUI was unresponsive because loadRecentChats() ran before contacts were synced

Changes

  1. Dependency bump: go.mau.fi/whatsmeow from 2026032720260730 (fixes Pairing fails with err-client-outdated on v1.1.5 #132)
  2. Chat loading flow: Move loadRecentChats() from immediate post-connect to the Connected event handler, ensuring contacts/groups are available before loading
  3. New event handler: OfflineSyncCompleted — triggers chat reload when offline sync finishes
  4. Graceful fallback: Show "Waiting for WhatsApp to sync chats..." when no chats are loaded yet

Files changed

  • go.mod / go.sum — dependency bump
  • messages/session_manager.go — event handling and chat loading flow

Closes #132

- Bump go.mau.fi/whatsmeow from 20260327 to 20260730 to fix 405 error
- Move loadRecentChats() from immediate post-connect to Connected event
- Handle OfflineSyncCompleted event for chat reloading
- Add fallback message when no chats loaded yet
@joivo
joivo force-pushed the fix/client-outdated-whatsmeow-v2 branch from a3e023f to b78c3bd Compare August 4, 2026 01:05
joivo added 2 commits August 3, 2026 22:20
AddMessage was doing sort.Slice (O(N log N)) on every message insert.
During history sync, this caused O(M * N log N) operations where M is
the message count, freezing the UI for 10+ minutes.

Move sort to GetMessages (called once on chat open) and scan for
minimum in GetOldestMessage instead of relying on sorted order.
Keep only the storage.go performance fix (sort on read instead
of write). Event handler changes not compatible with the current
app startup flow.
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.

Pairing fails with err-client-outdated on v1.1.5

1 participant