Allow null cipher name to fix collection assignment #66

Closed
opened 2026-04-05 20:29:28 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @xjohnyknox on 3/13/2026

Summary

When a cipher is created without a name (e.g. via alternative clients like Keyguard), assigning it to a collection via the web vault fails with:

Data guard `Json < ShareSelectedCipherData >` failed: Parse("...", Error("invalid type: null, expected a string", line: 1, column: 213))

The root cause is that CipherData.name is typed as String, so serde rejects null during deserialization — causing the entire request (including the collection assignment) to fail.

Changes

  • Changed CipherData.name from String to Option<String>
  • All usages default to an empty string via unwrap_or_default(), keeping the Cipher model and DB schema unchanged

This follows the same pattern already used by other optional fields in CipherData (e.g. notes, key, fields).

Test plan

  • Create a cipher without a name via an alternative client or direct API call
  • Verify the cipher can be assigned to a collection from the web vault without errors
  • Verify normal cipher creation/update/sharing still works as expected

Fixes #6933

*Originally created by @xjohnyknox on 3/13/2026* ## Summary When a cipher is created without a name (e.g. via alternative clients like [Keyguard](https://github.com/AChep/keyguard-app)), assigning it to a collection via the web vault fails with: ``` Data guard `Json < ShareSelectedCipherData >` failed: Parse("...", Error("invalid type: null, expected a string", line: 1, column: 213)) ``` The root cause is that `CipherData.name` is typed as `String`, so serde rejects `null` during deserialization — causing the entire request (including the collection assignment) to fail. ## Changes - Changed `CipherData.name` from `String` to `Option<String>` - All usages default to an empty string via `unwrap_or_default()`, keeping the `Cipher` model and DB schema unchanged This follows the same pattern already used by other optional fields in `CipherData` (e.g. `notes`, `key`, `fields`). ## Test plan - [ ] Create a cipher without a name via an alternative client or direct API call - [ ] Verify the cipher can be assigned to a collection from the web vault without errors - [ ] Verify normal cipher creation/update/sharing still works as expected Fixes #6933
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#66