openimsdk / open-im-sdk-flutter

IM SDK Flutter
https://openim.io
MIT License
365 stars 232 forks source link

[BUG] flutter_openim_sdk error Unhandled Exception: PlatformException(10303, 10303 unread count has zero, null, null) #150

Closed LionYan-Coder closed 2 months ago

LionYan-Coder commented 3 months ago

Describe the bug

 Launching the app, going to chat and going back to conversation will result in this error and is only available on ios

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(10303, 10303 unread count has zero, null, null)

How to reproduce

Steps to reproduce the behavior:

  1. Go to Conversation page
  2. Click any chat
  3. back Conversation page
  4. Error occurred.

Expected behavior

Screenshots (If contains)

356962166-0e5c6ae1-3def-469c-b26d-e7feb703b0b6

Version information

Additional context

std-s commented 3 months ago

Hi, does this session have any unread counts? If there are no unread counts, there is no need to call this API.

TheOneT1 commented 3 months ago

请问你如何解决的这个问题,我也遇到了这个问题 @LionYan-Coder @std-s

std-s commented 3 months ago

If the conversation's unread count is 0, there is no need to call 'markConversationMessageAsRead'.

skiffer-git commented 3 months ago

This shouldn't be considered an exception. Is it better to handle this issue within Flutter, or should it be dealt with at the SDK core level?

@std-s

std-s commented 2 months ago

The sdk handles it better.