awslabs / awslabs/aws-mobile-appsync-sdk-android
Subscription failure
- Dominant language
- Java
- Stars
- 106
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Use to example EventApp from AWS AppSync, Subscriptions return a error:
`E/ViewEventActivity: Subscription failure
com.apollographql.apollo.exception.ApolloException: Failed to parse subscription response: {errors=[{errorType=BadRequestException, message=Subscriptions over MQTT is not supported.}]}
at com.apollographql.apollo.internal.interceptor.AppSyncSubscriptionInterceptor$1$1.run(AppSyncSubscriptionInterceptor.java:105)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference
at com.apollographql.apollo.internal.interceptor.AppSyncSubscriptionInterceptor$1$1.run(AppSyncSubscriptionInterceptor.java:79)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923) `
**To Reproduce**
Steps to reproduce the behavior:
1. Go to Dashboard Event
2. Click on Event Created
3. Type a comment and click to ADD COMMENT
4. See error in console.
**Screenshots**

**Environment(please complete the following information):**
- AppSync SDK Version: 3.6.1
- Android Studio Version: 4.2.2
**Device Information (please complete the following information):**
- Device: OnePlus IN2020
- Android Version: 11
Contributor guide
Research direction
Reproduce the EventApp flow described in the issue, then inspect AppSyncSubscriptionInterceptor.java around lines 79 and 105. Compare the reported MQTT-not-supported response with the resulting ApolloException and NullPointerException; done means the failure is handled without the secondary null-reference error, though the intended subscription behavior is not specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, aws, graphql, java
- Domain
- api, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100