You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(server): store null instead of empty string for session deviceType and deviceOS
Aligns session.deviceType and session.deviceOS with the pattern established
by #30223 (user.password), #30123 (album.description) and #31560
(user.oauthId): the database stores NULL instead of '' when the field is
unknown, while API responses continue to return '' for backwards
compatibility until v4.
Changes:
- schema: DB columns nullable with default NULL, migration converts
existing '' rows.
- database.ts / session.table.ts: Session.deviceType and .deviceOS are now
string | null.
- session.dto.ts:
- SessionCreateSchema input accepts null/undefined/'' and coerces to
null (TODO(v4): drop the transform, clients should send null).
- SessionResponseSchema stays z.string() and mapSession coerces
null -> '' with a TODO(v4) note.
- utils/request.getUserAgentDetails: returns null instead of '' when the
header can't be parsed, so new sessions written by the login flow store
null directly.
- LoginDetails type + affected test fixtures updated to match.
Refs #28832
0 commit comments