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

Lambda Invocation Type is always "RequestResponse" #459

Closed
v360 opened this issue May 15, 2018 · 2 comments
Closed

Lambda Invocation Type is always "RequestResponse" #459

v360 opened this issue May 15, 2018 · 2 comments
Labels
bug Something isn't working feature-request Request a new feature lambda Issues with the AWS Android SDK for Lambda.

Comments

@v360
Copy link

v360 commented May 15, 2018

To help us solve your problem better, please answer the following list of questions.

  • What service are you using?
    Lambda

  • In what version of SDK are you facing the problem?
    2.6.19

  • Is the issue limited to Simulators / Actual Devices?
    All devices

  • Can your problem be resolved if you bump to a higher version of SDK?
    No

  • Is this problem related to specific Android/OS version?
    No

  • Can you give us steps to reproduce with a minimal, complete, and verifiable example? Please include any specific network conditions that might be required to reproduce the problem.

LambdaInvocationHandler.java has the following piece of code:

.....
        // If the log type is other than 'None', force to be RequestResponse.
        if (!LogType.None.equals(lambdaFunction.logType())) {
            invokeRequest.setInvocationType(InvocationType.RequestResponse);
        } else {
            invokeRequest.setInvocationType(lambdaFunction.invocationType());
        }
.....

The condition always evaluates to true and hence specifying Event/DryRun invocationType in the annotation have no effect.

There is a lint warning that indicates the above problem as well:
'equals()' between objects of inconvertible types 'LogType' and 'String'

You can also check it easily that LogType.None.equals("None") evaluates to false due to the above.

When request and HTTP client logging are enabled, we can clearly see that the X-Amz-Invocation-Type header is always set to RequestResponse even if we have the annotation set correctly as @LambdaFunction(invocationType = "Event")

  • Please include a stacktrace if applicable.

If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application by using Mobile Hub.

@mutablealligator mutablealligator added lambda Issues with the AWS Android SDK for Lambda. investigating labels May 15, 2018
@mutablealligator
Copy link
Contributor

mutablealligator commented May 21, 2018

Thank you @v360 for reporting to us. Sorry for the inconvenience caused.
There are two parts to this issue.

Feature Request:
Currently, the InvocationType.Event can only be used with LogType.None. To rephrase, InvocationType can only be RequestResponse if LogType is not None. This is a limitation.
See https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax LogType section for further details.

Bug:
We will fix the bug in the code where we compare log types and update this thread when the fix is out. Thank you!

@mutablealligator mutablealligator self-assigned this May 21, 2018
@mutablealligator mutablealligator added bug Something isn't working feature-request Request a new feature and removed investigating labels May 22, 2018
@minbi
Copy link
Contributor

minbi commented Aug 3, 2018

Hi @v360 ,

We have released version 2.6.27 with the fix you suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature-request Request a new feature lambda Issues with the AWS Android SDK for Lambda.
Projects
None yet
Development

No branches or pull requests

3 participants