-
Notifications
You must be signed in to change notification settings - Fork 154
chore(idempotency): expiration timestamp rounded to the nearest second #2574
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
chore(idempotency): expiration timestamp rounded to the nearest second #2574
Conversation
Hi @arnabrahman - thank you for opening this PR! While I review it and run tests, could I please ask you to leave a comment under the linked issue so that I can assign it to you? (GitHub doesn't let me do it unless you interact with it first). |
Integration tests are failing on this branch - I need to check why as it's not immediately clear from the logs. |
Regarding the failing integration test, it's possible that the sorting order is being affected because we are rounding off the For example, previously if this was the
After sorting, the But now, if the value is rounded off, the
And after sorting, the
This is likely why we get However, I'm not entirely certain. To validate this, need the actual values for |
Thank you for looking into it, you are exactly right. I have tested this on my local branch and it works, I'd suggest to replace the sorting here with this: const idempotencyRecordsItems = [
idempotencyRecords.Items?.find(
(record) =>
record.customId ===
`${functionNameCustomConfig}#${payloadHashes[0]}`
),
idempotencyRecords.Items?.find(
(record) =>
record.customId ===
`${functionNameCustomConfig}#${payloadHashes[1]}`
),
idempotencyRecords.Items?.find(
(record) =>
record.customId ===
`${functionNameCustomConfig}#${payloadHashes[2]}`
),
]; and the one here with this: const idempotencyRecordsItems = [
idempotencyRecords.Items?.find(
(record) => record.id === `${functionNameDefault}#${payloadHashes[0]}`
),
idempotencyRecords.Items?.find(
(record) => record.id === `${functionNameDefault}#${payloadHashes[1]}`
),
]; Once replaced I'll run the tests again and if green, I think we should be able to merge! |
I have updated the tests. You can try it now, @dreamorosi |
Thank you - seems to work now, great job! |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this PR and for iterating on the feedback.
Summary
For consistency, we need to align timestamp formats for
expiration
andin_progress_expiration
in idempotency table. To achieve this we have to round offexpiration
attribute.Changes
getExpiryTimestamp
functionIssue number: #2298
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.