ENG-2594: Add received_at column to currentprivacypreferencev2#7696
Merged
ENG-2594: Add received_at column to currentprivacypreferencev2#7696
Conversation
Add a nullable received_at column to CurrentPrivacyPreference so the companion fidesplus fix can compare incoming received_at against the stored value instead of updated_at (server write time). This fixes incorrect current preferences when backfill scripts send historical timestamps via the pre-verified endpoint.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
Greptile SummaryThis PR adds a nullable Key observations:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: "ENG-2594: Add receiv..." |
tvandort
reviewed
Mar 18, 2026
...fides/api/alembic/migrations/versions/xx_2026_03_18_1800_d98cea042828_add_received_at_to_.py
Outdated
Show resolved
Hide resolved
galvana
approved these changes
Mar 18, 2026
Linker44
added a commit
that referenced
this pull request
Mar 19, 2026
Cherry-picked from PR #7696 (main). Down revision updated to a1b2c3d4e5f7 (jp-alpha head).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-2594
Description Of Changes
_upsert_preferences_saved()compared incomingreceived_atagainstupdated_at(server write time) onCurrentPrivacyPreference. For backfill scripts sending historical timestamps via the pre-verified endpoint,updated_atis always "now", so every submission was marked as "truly historical" — only the first processed entry became the current preference regardless of actual chronological order.The fix (in the companion fidesplus PR) compares
received_atvsreceived_at, falling back toupdated_atfor legacy records. This PR adds the column to store that value.Migration notes: The migration adds a nullable column with no default — this is a metadata-only operation in PostgreSQL, instant regardless of row count. Existing records will have
NULLreceived_atand will fall back toupdated_atuntil organically updated. No data backfill needed.Companion PR: https://github.com/ethyca/fidesplus/pull/3260
Code Changes
received_atcolumn toCurrentPrivacyPreferencemodeld98cea042828to add the column tocurrentprivacypreferencev2Steps to Confirm
alembic upgrade headand verify thereceived_atcolumn exists oncurrentprivacypreferencev2alembic downgrade -1and verify the column is removedNULLreceived_atPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works