aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 557 forks source link

SES Interface change is not compatible #6102

Closed 291devoss closed 3 weeks ago

291devoss commented 1 month ago

Pre-Migration Checklist

Which JavaScript Runtime is this issue in?

Node.js (includes AWS Lambda)

AWS Lambda Usage

Describe the Migration Issue

SES SendEmailResponse Interface change in v2 to v3 is not compatible because "MessageId" property can be undefined in v3. Is there any case that "MessageId" will be undefined without throwing any Exception? If it is yes I need to know when the property will be undefined. If it is no I think "MessageId" property should be string. This difference is not written in any document I saw.

Code Comparison

No response

Observed Differences/Errors

aws-sdk v2 interface definition

...
  export interface SendEmailResponse {
    /**
     * The unique message identifier returned from the SendEmail action. 
     */
    MessageId: MessageId;
  }
...
  export type MessageId = string;

aws-sdk v3 interface definition

/**
 * <p>Represents a unique message ID.</p>
 * @public
 */
export interface SendEmailResponse {
    /**
     * <p>The unique message identifier returned from the <code>SendEmail</code> action. </p>
     * @public
     */
    MessageId: string | undefined;
}

Additional Context

No response

RanVaknin commented 1 month ago

Hi @291devoss ,

Please refer to my response here https://github.com/aws/aws-sdk-js-v3/issues/5992#issuecomment-2052253822

Thanks, Ran~

291devoss commented 1 month ago

@RanVaknin Thanks, I read https://github.com/aws/aws-sdk-js-v3/issues/5992#issuecomment-2052253822, but we cannot easily apply with the solution, UncheckedClient or AssertiveClient . We have to handle the process when "MessageId" property was undefined. So far, is it right that an unexpected error had happened when required property in aws-sdk-v2, like the "MessageId" property was undefined.

RanVaknin commented 1 month ago

Hi @291devoss ,

So far, is it right that an unexpected error had happened when required property in aws-sdk-v2, like the "MessageId" property was undefined.

If I understand what you are asking correctly, the change in interface in v3 only represent a change in SDK behavior. From an SES API perspective there is no change you can safely assert no null for this parameter as you were using it in v2. I'm not an SES expert, but AFAIK when a valid response (not an Exception) is returned by the SES for SendEmail, there is always going to be a messageID returned with it.

This change in response interface is not unique to SES, it would be across the board for all v3 response interfaces for the reasons mentioned in #5992.

Thanks, Ran~

github-actions[bot] commented 1 month ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] commented 1 week ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.