Skip to content

[PM-45328] Export empty custom field values as empty strings in CSV exports - #23970

Merged
harr1424 merged 3 commits into
bitwarden:mainfrom
sebxt:fix/csv-export-null-field-value
Oct 30, 2026
Merged

harr1424 merged 3 commits into
bitwarden:mainfrom
sebxt:fix/csv-export-null-field-value

Conversation

@sebxt

@sebxt sebxt commented Oct 19, 2026 •

Copy link
Copy Markdown

Tracking

https://bitwarden.atlassian.net/browse/PM-45328
https://bitwarden.atlassian.net/browse/PM-45327

Fixes CSV exports writing null / undefined for custom fields without a value (no existing issue found).

Objective

BaseVaultExportService.buildCommonCipher builds the CSV fields column with name + ": " + f.value. For fields without a value, such as linked fields or empty text and hidden fields, this writes the literal text null or undefined. Re-importing the file creates text fields with those strings as values.

This change falls back to an empty string for the value, the same way the name already does. The Bitwarden CSV importer reads Name: back as a field with no value, so export and import now round trip.

Added a test in individual-vault-export.service.spec.ts covering a text field with a value, an empty text field and a linked field in a CSV export.

Fixes #23969

Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
@sebxt
sebxt requested a review from a team as a code owner October 19, 2026 14:02
@CLAassistant

CLAassistant commented Oct 19, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal Community PR board for review.
ID: PM-45328
Link: https://bitwarden.atlassian.net/browse/PM-45328

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title Export empty custom field values as empty strings in CSV exports [PM-45328] Export empty custom field values as empty strings in CSV exports Oct 19, 2026
@bitwarden-bot bitwarden-bot added community-pr needs-qa Marks a PR as requiring QA approval labels Oct 19, 2026
@harr1424

harr1424 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Hi @sebxt thanks for your first contribution! Before exploring your pull request, I wanted to point out that our Contributor License Agreement must be signed before we are able to accept any contribution. Please tag me here if you have any questions or encounter any difficulties.

@harr1424 harr1424 added needs-changes Closes PR if no further changes after 21 days and removed needs-changes Closes PR if no further changes after 21 days labels Oct 20, 2026
@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 61.35%. Comparing base (53361f6) to head (c36145a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ult-core/src/services/base-vault-export.service.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #23970   +/-   ##
=======================================
  Coverage   61.35%   61.35%           
=======================================
  Files        4883     4883           
  Lines      157340   157340           
  Branches    25201    25201           
=======================================
+ Hits        96529    96533    +4     
+ Misses      54190    54186    -4     
  Partials     6621     6621           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@harr1424

Copy link
Copy Markdown
Contributor

Thanks again for your contribution, @sebxt . I've reviewed these changes and have sent them to QA for detailed testing. I'll reach out here if any questions arise.

@harr1424 harr1424 removed the needs-qa Marks a PR as requiring QA approval label Oct 30, 2026
@harr1424 harr1424 added the t:bugfix Change Type - Bugfix label Oct 30, 2026
@brandonbiete brandonbiete added the ci:signed-build Runs fork PR build workflows with secrets (including artifact signing) label Oct 30, 2026
@github-actions github-actions Bot removed the ci:signed-build Runs fork PR build workflows with secrets (including artifact signing) label Oct 30, 2026
@harr1424
harr1424 merged commit 966580c into bitwarden:main Oct 30, 2026
280 of 284 checks passed
@harr1424

Copy link
Copy Markdown
Contributor

@sebxt your contribution has been merged! Thank you for taking the time to improve our product.

@djsmith85 djsmith85 added browser Browser Extension desktop Desktop Application cli CLI Application web labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

browser Browser Extension cli CLI Application community-pr desktop Desktop Application t:bugfix Change Type - Bugfix web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV export writes "null" or "undefined" for custom fields that have no value

6 participants