awslabs / awslabs/aws-mobile-appsync-sdk-android
Mutation request submitted twice for long running task - disable auto retry.
- Dominant language
- Java
- Stars
- 106
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Mutation request is submitted twice when backend takes a while to return the response or internet connection is slower.
It works when backend returns result quickly.
**How to disable mutation retry policy? i.e. submit mutation only once or fail.**
**To Reproduce**
Steps to reproduce the behavior:
1. Create AppSyncClient
```
private static volatile AWSAppSyncClient client;
public synchronized static AWSAppSyncClient getInstance(Context context) {
if (client == null) {
AWSConfiguration awsConfig = new AWSConfiguration(context);
client = AWSAppSyncClient.builder()
.context(context.getApplicationContext())
.awsConfiguration(awsConfig)
.build();
}
return client;
}
```
2. Submit mutation request
```
client.mutate(mutation)
.enqueue(new ...
```
3. Make sure backend executes a long-running task > 10-15 seconds.
4. The same mutation request is submitted twice.
**Expected behavior**
Mutations must not be submitted twice. Disable retry policy for mutations.
**Environment(please complete the following information):**
- AppSync SDK Version: [3.1.0]
**Device Information (please complete the following information):**
- Android 10
- Samsung A20
Contributor guide
Research direction
Start by tracing AWSAppSyncClient.mutate(mutation).enqueue(...) in the Android SDK and examine how a long-running request is handled after the 10–15 second delay described. Reproduce the issue with AppSync SDK 3.1.0 and confirm that a mutation is submitted only once or fails without a second submission.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, aws, java
- Domain
- api, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100