Skip to content

fix: prevent setting negative item created at timestamps#2913

Merged
antsgar merged 2 commits into
mainfrom
fix/prevent-negative-created-at-timestamps
Jul 9, 2025
Merged

fix: prevent setting negative item created at timestamps#2913
antsgar merged 2 commits into
mainfrom
fix/prevent-negative-created-at-timestamps

Conversation

@antsgar

@antsgar antsgar commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

Although we have some logic preventing a payload from having a negative created_at or updated_at timestamp, when only the date fields are set and not the timestamp ones, the condition checking for a negative timestamp is not triggered. The timestamp is afterwards calculated from the date attributes, and if those correspond to a date before 1970-01-01, a negative timestamp is stored in the database.

This PR updates the logic so that it also checks for a created_at or updated_at field where the date is before 1970-01-01.

@antsgar antsgar requested review from atmoio and karolsojko July 7, 2025 22:36
@antsgar antsgar force-pushed the fix/prevent-negative-created-at-timestamps branch from 379a217 to 85fb321 Compare July 7, 2025 22:39
@antsgar antsgar merged commit 2459e06 into main Jul 9, 2025
7 of 8 checks passed
@antsgar antsgar deleted the fix/prevent-negative-created-at-timestamps branch July 9, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants