Skip to content

[BUG] Android application switches to the background, NotificationChatType message cannot be received #1031

@guoqizssck-glitch

Description

@guoqizssck-glitch

OpenIM SDK Version

3.8.3 hotfix7

OpenIM Server Version

3.8.3

SDK Platform

Flutter SDK

Device Model

红米K30 5G

Operating System Version

MIUI 13.0.5

Bug Description and Steps to Reproduce

1、安卓端应用正常启动,并成功登录openim
2、手动将应用切换到系统后台
3、服务端通过/msg/send_msg接口,以超级管理员的身份发送一个NotificationChatType的消息给该安卓端账号
4、安卓端没有收到消息,没有触发onRecvNewMessage、OnRecvOfflineNewMessage回调

通过看core的代码,发现在conversation_msg.go的newMessage方法中,如果切后台,对于NotificationChatType类型的消息,conversationID := utils.GetConversationIDByMsg(w),该ID不在cc和nc集合中,获取不到有效的ConversationID,所以没有处理该消息

Screenshots Link

Image

Metadata

Metadata

Assignees

Labels

bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions