Skip to content

[BUG] 获取最近会话列表失败 #228

@MiftMy

Description

@MiftMy

杀掉APP重新获取最近会话返回空。

How to reproduce
final success = await OpenIM.iMManager.initSDK(
platformID: IMPlatform.ios,
// 平台,参照IMPlatform类,
apiAddr: "http://xxxx:10002",
// SDK的API接口地址。
wsAddr: "ws://xxxx:10001",
// SDK的web socket地址
dataDir: savePath,
// objectStorage: 'cos', // 图片服务器默认'cos'
logLevel: 6,
// 日志等级,默认值6
listener: OnConnectListener(
onConnectSuccess: () {
debugPrint('IM: connect success');
_loginSuccessHandle();
},
onConnecting: () {
// 正在连接到服务器,适合在 UI 上展示“正在连接”状态。
debugPrint("IM: connecting .... ");
},
onConnectFailed: (code, errorMsg) {
// 连接服务器失败,可以提示用户当前网络连接不可用
debugPrint('IM: connect failed: ${code}:${errorMsg}');
},
onUserTokenExpired: () {
debugPrint('IM: token expired');
_requestImTokenAndLogin();
},
onKickedOffline: () {
ToastUtil.showToast("IM: kicked off line");
},
),
);

final val = await getLoginStatus();
if (val == 3) {
return;
}
final userInfo = await OpenIM.iMManager.login(
userID: mid,
token: pwd,
);

OpenIM.iMManager.conversationManager
.getOneConversation(sourceID: targetId, sessionType: 1);

Steps to reproduce the behavior:

1、flutter 应用,首次登录IM,获取最近会话列表,功能正常非空(已添加过好友和聊天)。
2、后台杀掉APP(未调用退出),重启,获取到登录状态是3,但是获取最近会话列表是空的。
3、或者后台杀掉APP(未调用退出),重启,调用登录无反应(登录状态是3)。后端把token无效后,重新获取token登录,能正常登录,但是获取最近会话列表也是空的。

Expected behavior
正常获取到最近会话列表

Version information

  • Device: iPhone 模拟器
  • OS: iOS 17
  • Package Version: v3.8.3+3
  • Flutter Version: *e.g. v3.19.6

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