[PR #7283] [MERGED] fix(sends): emit hideEmail as non-null boolean in sync response #41349

Closed
opened 2026-07-18 06:16:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/7283
Author: @kvdb
Created: 6/1/2026
Status: Merged
Merged: 7/7/2026
Merged by: @BlackDex

Base: mainHead: fix/send-hideemail-non-null


📝 Commits (1)

  • 2c97b41 fix(sends): emit hideEmail as non-null boolean in sync response

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/db/models/send.rs (+1 -1)

📄 Description

Problem

GET /api/sync returns "hideEmail": null for Sends whose hide_email column is NULL. The sends.hide_email column is Nullable<Bool> with no default (added in migration 2021-05-11-205202_add_hide_email), so it is NULL for older Sends and any code path that leaves it unset.

The Bitwarden Android client deserializes SyncResponseJson.Send.hideEmail as a non-null Kotlin Boolean and throws a JsonDecodingException, aborting the entire sync. Web, desktop and CLI clients coerce null to false, so only accounts with at least one Send are affected, and only on Android.

The official Bitwarden server treats hideEmail as non-nullable.

Fix

Default None to false at the serialization boundary in Send::to_json():

"hideEmail": self.hide_email.unwrap_or(false),

The field stays Option<bool> internally. No DB migration is required, and this fixes both existing NULL rows and any future NULLs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/7283 **Author:** [@kvdb](https://github.com/kvdb) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 7/7/2026 **Merged by:** [@BlackDex](https://github.com/BlackDex) **Base:** `main` ← **Head:** `fix/send-hideemail-non-null` --- ### 📝 Commits (1) - [`2c97b41`](https://github.com/dani-garcia/vaultwarden/commit/2c97b41e879a84f99147fcae299f4f7404e377cf) fix(sends): emit hideEmail as non-null boolean in sync response ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/db/models/send.rs` (+1 -1) </details> ### 📄 Description ### Problem `GET /api/sync` returns `"hideEmail": null` for Sends whose `hide_email` column is NULL. The `sends.hide_email` column is `Nullable<Bool>` with no default (added in migration `2021-05-11-205202_add_hide_email`), so it is NULL for older Sends and any code path that leaves it unset. The Bitwarden Android client deserializes `SyncResponseJson.Send.hideEmail` as a non-null Kotlin `Boolean` and throws a `JsonDecodingException`, aborting the **entire** sync. Web, desktop and CLI clients coerce null to `false`, so only accounts with at least one Send are affected, and only on Android. The official Bitwarden server treats `hideEmail` as non-nullable. ### Fix Default `None` to `false` at the serialization boundary in `Send::to_json()`: ```rust "hideEmail": self.hide_email.unwrap_or(false), ``` The field stays `Option<bool>` internally. No DB migration is required, and this fixes both existing NULL rows and any future NULLs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-07-18 06:16:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#41349