Skip to content

Friend application notification 1203 ServerFriendRequestToLocalFriendRequest null pointer panic during processing #1108

Description

@cqlmim

环境

  • 客户端:flutter_openim_sdk 版本:____
  • 日志里 sdk-core 版本:v3.8.3-patch.10
  • 平台:Android(架构:arm64-v8a 等)

现象

收到好友申请推送后,native 在处理通知时 panic,Dart 侧 onFriendApplicationAdded 不稳定/收不到。

完整 panic 栈

(粘贴之前 DoListener panic 的整段 stack,含 ServerFriendRequestToLocalFriendRequestrelation/notification.go

复现步骤

  1. 用户 A 向用户 B 发起好友申请
  2. B 端在线,收到 pushMsg / notification

关键日志(push / notification)

(粘贴你这段 pushMsgnotification handlingNotificationCmd end 的 JSON/文本即可)

content 解码(便于核对协议)

1203 消息的 content(base64)解码后示例:
{"detail":"{\"fromToUserID\":{\"fromUserID\":\"1442403458\",\"toUserID\":\"5225942209\"}}"}

(把你们的真实 from/to 保留或打码均可)

期望行为

处理 1203 不 panic,并正常同步好友申请 / 触发上层回调。

实际行为

runtime error: invalid memory address or nil pointer dereferenceServerFriendRequestToLocalFriendRequest(conversion.go)。
{"operationID": "1778035070832", "push": "notificationMsgs:{key:"n_1442403458_5225942209" value:{Msgs:{sendID:"1442403458" recvID:"5225942209" clientMsgID:"1133539146d040cb98d5cac4f7858e67" serverMsgID:"5158216e5b88af939f60176226e50cba" sessionType:1 msgFrom:200 contentType:1203 content:"{\"detail\":\"{\\\"fromToUserID\\\":{\\\"fromUserID\\\":\\\"1442403458\\\",\\\"toUserID\\\":\\\"5225942209\\\"}}\"}" sendTime:1778035071989 createTime:1778035071988 options:{key:"conversationUpdate" value:false} options:{key:"history" value:false} options:{key:"isNotNotification" value:false} options:{key:"isSendMsg" value:false} options:{key:"notPrivate" value:false} options:{key:"offlinePus
I/GoLog (27119): h" value:false} options:{key:"persistent" value:false} options:{key:"reactionFromCache" value:false} options:{key:"senderConversationUpdate" value:false} options:{key:"senderSync" value:true} options:{key:"unreadCount" value:false} offlinePushInfo:{title:"Somebody applies to add you as a friend" desc:"Somebody applies to add you as a friend" ex:"Somebody applies to add you as a friend"}}}}", "syncedMaxSeqs": {"n_4107844326":697,"sg_4107844326":6899}}
I/GoLog (27119): 2026-05-06 02:37:51.583 INFO [PID:27119] [v3.8.3-patch.10] [flutter/Android]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions