Repository navigation
Codex/fix whatsmeow lifecycle - #237
jadercarvalhoPRM wants to merge 5 commits into
Conversation
Reviewer's GuideThis PR fixes WhatsMeow lifecycle races and outdated-client failures by introducing serialized per-instance generation ownership, shared auth-store reuse, dynamic handshake version application, stronger session validation, and comprehensive regression/integration coverage; it also hardens logging and adds CI workflows for runtime, vulnerability, multi-architecture publication, and supply-chain verification. Sequence diagram for serialized WhatsMeow instance lifecyclesequenceDiagram
participant API as InstanceService
participant WM as WhatsmeowService
participant Gen as lifecycleGeneration
participant Client as WhatsmeowClient
participant Repo as InstanceRepository
API->>WM: StartInstance(instanceId)
WM->>WM: lifecycleLock(instanceId)
WM->>WM: newGeneration(instanceId)
WM->>WM: startClient(clientData, generation)
WM->>Client: Connect()
WM->>WM: publishClient(instanceId, generation, client)
WM->>Gen: generationStarted(instanceId, generation)
API->>WM: StopInstance(instanceId, token, logout)
WM->>Gen: beginStop()
Gen-->>WM: ctx.Done()
WM->>Client: Logout(context)
WM->>Client: Disconnect()
WM->>Gen: finishGeneration(instanceId, generation, client, myClient)
Gen->>Gen: workers.Wait()
WM->>Repo: UpdateConnected(instanceId, false, reason)
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Fixed security issues:
- github.com/chai2010/webp (link)
- github.com/jackc/pgx/v5 (link)
- github.com/klauspost/compress (link)
- github.com/rabbitmq/amqp091-go (link)
- golang.org/x/crypto (link)
- golang.org/x/image (link)
- golang.org/x/net (link)
- golang.org/x/text (link)
Sourcery assessment
Needs a human reviewer. A lifecycle bug in StopInstance or Logout could disconnect a WhatsApp device and invalidate its stored session, forcing the user to pair again. Reverting restores the previous lifecycle code but cannot restore sessions already invalidated.
Description
Related Issue
Closes #(issue_number)
Type of Change
Testing
Screenshots (if applicable)
Checklist
Additional Notes
Summary by Sourcery
Harden WhatsApp client lifecycle and authentication handling while validating the fix through integration gates and publishing an attested release image.
Bug Fixes:
Enhancements:
Build:
CI:
Deployment:
Tests: