fix: update whatsmeow and fix post-connect chat loading - #135
Open
joivo wants to merge 3 commits into
Open
Conversation
- 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
force-pushed
the
fix/client-outdated-whatsmeow-v2
branch
from
August 4, 2026 01:05
a3e023f to
b78c3bd
Compare
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
405 Client OutdatederrorloadRecentChats()ran before contacts were syncedChanges
go.mau.fi/whatsmeowfrom20260327→20260730(fixes Pairing fails with err-client-outdated on v1.1.5 #132)loadRecentChats()from immediate post-connect to theConnectedevent handler, ensuring contacts/groups are available before loadingOfflineSyncCompleted— triggers chat reload when offline sync finishesFiles changed
go.mod/go.sum— dependency bumpmessages/session_manager.go— event handling and chat loading flowCloses #132