Devin
12/28/2021, 12:09 AMpk: SID#${messageid} | sk: SID#${messageid} | messageStatus | gsipk
Then twilio hits a callback with the SID# where I update the status. The front end polls against the gsipk
Once the msssageStatus
is delivered or failed
you can resend. This works pretty great 🎉. But I’m now storing each message in the database. Which is not needed. So, after creating a message, I’m just deleting the old message.
await dynamoDb.put(params);
if (shouldDeleteOldMessage) {
const existingItem = {
TableName: process.env.TABLE_NAME,
Key: {
pk: existingPk,
sk: existingPk,
},
};
await dynamoDb.delete(existingItem);
}
Seems bad to make the front end wait until after I delete the item (or worse fail because that operation fails.
I have some alternative thoughts but I’m curious what you’d do?thdxr
12/28/2021, 12:20 AMthdxr
12/28/2021, 12:20 AMthdxr
12/28/2021, 12:21 AMDevin
12/28/2021, 12:22 AMOmi Chowdhury
12/28/2021, 12:31 AMRoss Coundon
12/28/2021, 7:57 AM