-
Notifications
You must be signed in to change notification settings - Fork 646
Closed
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.workaround-availableThis issue has a work around available.This issue has a work around available.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
We are using the NodeJS package @aws-sdk/client-iot-data-plane to interact with AWS IoT Core. Since the update from v3.928.0 to v3.929.0 we can no longer delete retained messages. We usually send undefined in the payload of the PublishCommand. However with the new SDK version the topic is actually set to an empty object ({}) instead of being deleted. We also tried sending null or empty string ''. Always with the same result.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/client-iot-data-plane@3.928.0 --> @aws-sdk/client-iot-data-plane@3.929.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v22.18.0
Reproduction Steps
- Publish a payload to an MQTT topic.
- Publish
undefinedto the same MQTT topic. - Check whether retained topic still exists. --> Should result in
ResourceNotFoundException
import {
GetRetainedMessageCommand,
IoTDataPlaneClient,
PublishCommand
} from '@aws-sdk/client-iot-data-plane';
const client = new IoTDataPlaneClient({
region: 'eu-central-1'
});
await client.send(
new PublishCommand({
payload: JSON.stringify({
test: 'data'
}),
retain: true,
topic: 'test'
})
);
console.log(
'topic exists:',
await client
.send(
new GetRetainedMessageCommand({
topic: 'test'
})
)
.then(() => true)
.catch(() => false)
);
await client.send(
new PublishCommand({
payload: undefined,
retain: true,
topic: 'test'
})
);
console.log(
'topic exists:',
await client
.send(
new GetRetainedMessageCommand({
topic: 'test'
})
)
.then(() => true)
.catch(() => false)
);Observed Behavior
Retained topic is not being deleted.
Expected Behavior
Retained topic should have been deleted.
Possible Solution
No response
Additional Information/Context
No response
BjoernSaja, alexandergwosebosch, bilalahmad333 and jojokl
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team memberMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.workaround-availableThis issue has a work around available.This issue has a work around available.