Kommunicate-io / Kommunicate-Flutter-Plugin

A flutter plugin for Kommunicate customer support live chat.
BSD 3-Clause "New" or "Revised" License
16 stars 23 forks source link

iOS crashes when invoking KommunicateFlutterPlugin.buildConversation #90

Closed mbtodorov closed 11 months ago

mbtodorov commented 1 year ago

Hello 👋

We are using the kommunicate SDK. We've been having issues with crashes in our iOS production application for a while. Its impacted 110 sessions for the past 14 days in our app. We noticed that the release notes in the latest version of the SDK, 1.7.0, included a 'fixed crashes' items. We assumed this might address the crashes we are having.

image

However, even after upgrading to your latest version, the crashes still persist

image

I appreciate I haven't given any useful information around reproducing the issue. This is because we cant consistently reproduce it, there seem to be no clear steps. Let me know if I can provide any other helpful logs or other information. Any updates around this would be much appreciated!

Here is the entry for kommunicate_sdk from pubspec.lock:

  kommunicate_flutter:
    dependency: transitive
    description:
      name: kommunicate_flutter
      sha256: "915931eeec6e5abf5f450cda2be378c7d106e8e90bbc3501fda20bffbeecf05b"
      url: "https://pub.dev"
    source: hosted
    version: "1.7.0"

Here are all kommunicate-related entries from Podfile.lock:

  - Kommunicate (6.9.9):
    - KommunicateChatUI-iOS-SDK (~> 1.1.6)
  - kommunicate_flutter (0.0.1):
    - Flutter
    - Kommunicate (~> 6.9.2)
  - KommunicateChatUI-iOS-SDK (1.1.6):
    - KommunicateChatUI-iOS-SDK/Complete (= 1.1.6)
  - KommunicateChatUI-iOS-SDK/Complete (1.1.6):
    - iOSDropDown
    - Kingfisher (~> 7.6.2)
    - KommunicateChatUI-iOS-SDK/RichMessageKit
    - KommunicateCore-iOS-SDK (~> 1.1.1)
    - SwipeCellKit (~> 2.7.1)
    - ZendeskChatProvidersSDK (~> 3.0.0)
  - KommunicateChatUI-iOS-SDK/RichMessageKit (1.1.6)
  - KommunicateCore-iOS-SDK (1.1.1)
Sathyan-KM commented 1 year ago

@mbtodorov Thanks for reporting the issue. Let me check it. If I need more details , Will reach out to you.

AbhijeetRanjan308 commented 1 year ago

Hello @mbtodorov, could you please share the data you're passing in the 'build conversation' function? We're attempting to replicate the scenario that led to the crash.

mbtodorov commented 1 year ago

Yes, certainly!

class LiveChat {
  const LiveChat();

  /// Checks whether the user is currently logged in.
  Future<bool> get _isLoggedIn async =>
      await KommunicateFlutterPlugin.isLoggedIn() == true;

  Future<void> launchConversation({
    required String botId,
    required String userId,
    required String displayName,
    String? contactNumber,
    required String email,
    Map<String, dynamic>? metadata,
  }) async {
    if (!await _isLoggedIn) {
      final user = <String, dynamic>{
        'appId': kLiveChatAppId,
        'userId': email,
        'displayName': displayName,
        'contactNumber': contactNumber,
        'email': email,
        'metadata': metadata,
      };

      await KommunicateFlutterPlugin.login(user);
    }

    final conversationSettings = {
      'appId': kLiveChatAppId,
      'isSingleConversation': false,
      'conversationAssignee': botId,
    };

    await KommunicateFlutterPlugin.buildConversation(conversationSettings);
  }
}
AbhijeetRanjan308 commented 1 year ago

Thank you @mbtodorov for providing the details. Could you please specify if this issue is occurring on a particular iOS version or device, such as iPhone SE or iPhone 14?

mbtodorov commented 1 year ago

Sure, let me share the analytics we have around this error from the production app:

This is the OS version distribution:

image

It seems the error is hapenning on a lot of iOS versions, so I dont assume its some specific to an iOS version

And here is the device distribution, again it seems that its not tied to a single device:

image

device architecture distribtuion:

image

If it will help, I am happy to also provide some recordings from user bug reports, which show the app crashing

AbhijeetRanjan308 commented 1 year ago

Yes please share those crash videos, they will be very helpful.

mbtodorov commented 1 year ago

@AbhijeetRanjan308 could I email the recordings to you privately? We also have a slack channel with kommunicate and our company (stint), where I can share this

AbhijeetRanjan308 commented 1 year ago

Absolutely! Please feel free to send the email to support@kommunicate.io

AbhijeetRanjan308 commented 1 year ago

Hi @mbtodorov, just following up – did you send the videos via email or Slack?

mbtodorov commented 1 year ago

Apologies, this slipped my mind yesterday. I have now sent an email to support@stint.co which references this issue and includes an attached recording. Let me know if I can help in any other way!

AbhijeetRanjan308 commented 11 months ago

Hi @mbtodorov , we wanted to follow up on the release version 1.7.3 as we previously updated you via email about the changes. Has this issue been resolved for you?

mbtodorov commented 11 months ago

Hello. Yes, I can confirm that we updated the kommunicate plugin and the crash was fixed. Happy to close this!

AbhijeetRanjan308 commented 11 months ago

Thank you @mbtodorov for the update. We are glad to hear that the issue has been resolved.