Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listSubscriptions causes Android emulator crash #558

Open
EphemeralX opened this issue Nov 26, 2024 · 1 comment
Open

listSubscriptions causes Android emulator crash #558

EphemeralX opened this issue Nov 26, 2024 · 1 comment
Assignees

Comments

@EphemeralX
Copy link

EphemeralX commented Nov 26, 2024

Hello, I believe I found a bug in ably_flutter SDK for Android.

I am testing Android release mode on Pixel 7 simulator using the latest ably_flutter SDK version 1.2.36

I've isolated the code to the SDK's listSubscriptions function, sample code of my usage:

      final result = await chatChannel.push.listSubscriptions({
        "clientId": clientId,
      });

      const pushChannel = "chat:push";
      if (!result.items.any((sub) => sub.channel == pushChannel)) {
        await chatChannel.push.subscribeClient();
        print('PUSH: Subscribed to channel $pushChannel');
      }
      ```
      
I see a ClassCastException in the logs:

E/AndroidRuntime(10077): FATAL EXCEPTION: pool-22-thread-1
E/AndroidRuntime(10077): Process: co.whyapp, PID: 10077
E/AndroidRuntime(10077): java.lang.ClassCastException
E/AndroidRuntime(10077): at h.E.a(SourceFile:1)
E/AndroidRuntime(10077): at l6.f$b.a(SourceFile:9)
E/AndroidRuntime(10077): at l6.f$b$a.b(SourceFile:3)
E/AndroidRuntime(10077): at l6.f$b$a.a(SourceFile:1)
E/AndroidRuntime(10077): at o6.p$c.handleResponseBody(SourceFile:84)
E/AndroidRuntime(10077): at j6.b.h(SourceFile:9)
E/AndroidRuntime(10077): at j6.b.handleResponse(SourceFile:1)
E/AndroidRuntime(10077): at j6.f.d(SourceFile:37)
E/AndroidRuntime(10077): at j6.f.e(SourceFile:354)
E/AndroidRuntime(10077): at j6.f.f(SourceFile:42)
E/AndroidRuntime(10077): at j6.f.g(SourceFile:26)
E/AndroidRuntime(10077): at j6.h$c.b(SourceFile:38)
E/AndroidRuntime(10077): at j6.h$b.run(SourceFile:47)
E/AndroidRuntime(10077): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/AndroidRuntime(10077): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/AndroidRuntime(10077): at java.lang.Thread.run(Thread.java:1012)

I am using minSdk 23, targetSdk 34.

Has anyone encountered a similar issue?  It consistently crashes my Android app - everything works fine on iOS in both sim and physical device.

┆Issue is synchronized with this [Jira Task](https://ably.atlassian.net/browse/ECO-5145) by [Unito](https://www.unito.io)
@ttypic
Copy link
Contributor

ttypic commented Dec 12, 2024

Hello @EphemeralX,

I apologize for the delay. Could you please provide verbose logs for this error? We are unable to reproduce it, as both listSubscriptions and subscribeClient appear to be working fine on our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants