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

Mutation request submitted twice for long running task - disable auto retry. #309

Open
moin-eatclub opened this issue Aug 22, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@moin-eatclub
Copy link

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;
}
  1. Submit mutation request
client.mutate(mutation)
          .enqueue(new ...
  1. Make sure backend executes a long-running task > 10-15 seconds.
  2. 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
@TrekSoft TrekSoft added AppSync bug Something isn't working labels Sep 1, 2020
@jamesonwilliams
Copy link
Contributor

I believe the best solution will be for the AppSync service to enforce idempotent service in their service APIs. The client should attach a request ID for outbound requests. For the situation described in this issue, the client will use the same request ID, so AppSync will know that it is being asked to do the same logical work, and will reject the second request.

@dinnerdeal
Copy link

Anyone have any update on this one? Pretty critical one. We're seeing multiple triggers of mutations.

@CorainChicago
Copy link

This issue is still ongoing. The freedom to calibrate or disable retry logic is still needed. Some services have expected processing time, where matching the expected time to the need for an automatic retry is a business need.

@ds24449
Copy link

ds24449 commented Oct 1, 2023

Hi Team,

The freedom to calibrate or disable retry logic is still needed.

is there any update on this ? We are trying to use AppSync in our Android App and we wanted to use custom retry policy. From the code seems like even if we define our own OkHttp client, the RetryInterceptor will override it anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants