[PM-4128] Remove nullability of Send.Data and Send.Keys#7266
[PM-4128] Remove nullability of Send.Data and Send.Keys#7266
Conversation
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7266 +/- ##
==========================================
+ Coverage 57.62% 61.88% +4.26%
==========================================
Files 2033 2043 +10
Lines 89619 89868 +249
Branches 7978 7991 +13
==========================================
+ Hits 51642 55616 +3974
+ Misses 36117 32312 -3805
- Partials 1860 1940 +80 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Missing NULL backfill before NOT NULL constraint in all 3 EF migrations |
@rkac-bw This migration assumes that there are no NULL values in columns server/src/Core/Tools/Entities/Send.cs Lines 46 to 64 in 8310ea1 It would be prudent to query production data for any unexpected NULL values, unless you prefer the backfill occurs regardless. |
Cloud is fine — SQL Server has enforced NOT NULL on these columns since the table was created. For self-hosted instances on MySQL/MariaDB, PostgreSQL, or SQLite, we'd recommend a defensive backfill to MySQL/MariaDB: PostgreSQL: SQLite: No-op if no NULLs exist, prevents a migration failure if they do. |
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-4128
📔 Objective
While MSSQL already enforces that
Send.DataandSend.Keyare not nullable, theSendentity has been updated to reflect this and EF migration scripts have been generated.Note that as opposed to adding the
requiredkeyword to the now non-nullable properties, they are assigned a default initial value of empty string, this is ephemeral as the server will assign the key sent in the client request and assemble the JSON data from non-null components of the same request.See related PR #7212