aws / aws-sdk-js-v3

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

`waitUntilDBInstanceDelete` does not work - waiter errorType pointing to awsQueryError::code rather than ShapeId #6084

Open Eyjafjallaa opened 1 month ago

Eyjafjallaa commented 1 month ago

Checkboxes for prior research

Describe the bug

waitUntilDBInstanceDelete doesn't stop even target DBInstance is deleted

SDK version number

@aws-sdk/client-rds v3.573.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

19.1.0

Reproduction Steps

const DBINSTANCE = 'doesnotexist';
const client = new RDSClient(config);
const input = {
  DBInstanceIdentifier: DBINSTANCE,
};

await waitUntilDBInstanceDeleted(
  {
    client: client
  },
  input
)

console.log('end')

Observed Behavior

It should print end but doesn't stop

Expected Behavior

print end

Possible Solution

https://github.com/aws/aws-sdk-js-v3/blob/ac9ef805060eafa14c87dda8779d3892a749b76f/clients/client-rds/src/waiters/waitForDBInstanceDeleted.ts#L78-L81

I found that exception.name is "DBInstanceNotFoundFault" Not "DBInstanceNotFound"

I think condition should be exception.name && exception.name == "DBInstanceNotFoundFault"

Additional Information/Context

No response

RanVaknin commented 1 month ago

Hi @Eyjafjallaa ,

Thanks for reporting this. I'm able to confirm this issue.

The problem is likely with the smithy-typescript code generator.

Thanks, Ran~

kuhe commented 2 weeks ago

the model's waiter is pointed at "errorType": "DBInstanceNotFound". This is the awsQueryError trait code value and not the error shape id.

Checking with the teams to see whether the service should update the waiter or we should handle this indirection.