Skip to content

📱 Chatwoot app loses “Online” status when running in background #971

@Feeh03114

Description

@Feeh03114

Describe the bug

When the Chatwoot Android app is minimized or running in the background, the agent’s presence status changes from “Online (green)” to “Offline (gray)” after a short time.

Even with notifications enabled and battery optimization disabled, the agent is marked offline, which prevents auto-assignment from distributing new conversations.

Impact:

  • Auto-assignment fails because the agent is detected as offline.
  • Mobile agents do not receive new conversations while the app is in background.

To Reproduce

  1. Install the official Chatwoot Android app.
  2. Log in to a self-hosted Chatwoot instance (with HTTPS and auto-assign enabled).
  3. Confirm that the agent appears Online (green) in the web dashboard.
  4. Minimize the app (run it in the background).
  5. Wait a few seconds or minutes — the agent status turns Offline (gray) automatically.

Expected behavior

The agent should remain Online as long as the device has an active internet connection and push notifications are enabled — similar to typical chat applications (e.g., WhatsApp, Telegram).

Environment

Docker

Cloud Provider

Other [please specify in the description]

Platform

Mobile

Operating system

Linux VPS Ubuntu 22.04 + Portainer 2.27.4

Browser and version

Chrome 141.0.7390.108

Docker (if applicable)

root@srv802232:# docker version
Client:
Version: 27.5.1
API version: 1.47
Go version: go1.22.2
Git commit: 27.5.1-0ubuntu3
24.04.2
Built: Mon Jun 2 11:51:53 2025
OS/Arch: linux/amd64
Context: default

Server:
Engine:
Version: 27.5.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.2
Git commit: 27.5.1-0ubuntu324.04.2
Built: Mon Jun 2 11:51:53 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.24
GitCommit:
runc:
Version: 1.1.12-0ubuntu3.1
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
root@srv802232:
# docker info
Client:
Version: 27.5.1
Context: default
Debug Mode: false

Server:
Containers: 22
Running: 22
Paused: 0
Stopped: 0
Images: 155
Server Version: 27.5.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version:
runc version:
init version:
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.8.0-85-generic
Operating System: Ubuntu 24.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.755GiB
Name: srv802232
ID: c462bf02-9bcf-4b9d-8c7d-0c5d2aea1212
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

root@srv802232:# docker-compose version
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.12.3
OpenSSL version: OpenSSL 3.0.13 30 Jan 2024
root@srv802232:
#

Additional context

This issue directly affects auto-assignment logic, which depends on the agent’s “Online” presence.
Even with all Android battery and notification permissions set to unrestricted, the app loses the WebSocket connection when in background.

Suggestion:
Implement a keep-alive mechanism (e.g., heartbeat via FCM or background service) to preserve the agent’s presence state while the app runs in the background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions