[PR #6476] [CLOSED] Fix YNAB import failure with empty payee names #25163

Closed
opened 2026-04-16 18:25:46 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6476
Author: @Copilot
Created: 12/22/2025
Status: Closed

Base: masterHead: copilot/fix-empty-payee-field-import


📝 Commits (3)

  • 14922cd Initial plan
  • 11a76fd Fix empty payee field preventing YNAB import
  • 3caf2fa Merge branch 'master' into copilot/fix-empty-payee-field-import

📊 Changes

2 files changed (+8 additions, -4 deletions)

View changed files

📝 packages/loot-core/src/server/importers/ynab4.ts (+4 -2)
📝 packages/loot-core/src/server/importers/ynab5.ts (+4 -2)

📄 Description

YNAB exports can contain transactions with empty payee fields. When importing these budgets, the import fails with a generic "unknown" error because createPayee() requires a non-empty name field, throwing a ValidationError that bubbles up uncaught.

Changes

  • Skip importing payees with empty/null names in importPayees() for both YNAB4 and YNAB5 importers
  • Normalize empty imported_payee values to null in transaction mapping to prevent storing empty strings

Transactions referencing skipped payees will have payee: null, which the transaction import system already handles correctly.

// Before: would attempt to create payee and fail
for (const payee of data.payees) {
  if (!payee.deleted) {
    await actual.createPayee({ name: payee.name });
  }
}

// After: skip invalid payees
for (const payee of data.payees) {
  if (!payee.deleted && payee.name && payee.name.trim() !== '') {
    await actual.createPayee({ name: payee.name });
  }
}
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Empty payee field prevents import</issue_title>
<issue_description>### Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

My nYNAB import was failing with the message "unknown" and no other info. After much troubleshooting I found that I had a very old transaction that had the payee name in the memo field and nothing in the payee field. Once I swapped those the import completed successfully.

How can we reproduce the issue?

Attempt an nYNAB import with a blank payee name on a transaction.

Tested on Docker version 25.12.0 and https://app.actualbudget.org/.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome

Operating System

Mac OSX</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


🔄 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/actualbudget/actual/pull/6476 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/22/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `copilot/fix-empty-payee-field-import` --- ### 📝 Commits (3) - [`14922cd`](https://github.com/actualbudget/actual/commit/14922cd82d70a160dafeec01e4be8c4fb5eab4f3) Initial plan - [`11a76fd`](https://github.com/actualbudget/actual/commit/11a76fdadecf2462fb6388eda46aaecd5c2cbb6a) Fix empty payee field preventing YNAB import - [`3caf2fa`](https://github.com/actualbudget/actual/commit/3caf2fa9905fbc49a90ec57b0e719f7ee0e05e4e) Merge branch 'master' into copilot/fix-empty-payee-field-import ### 📊 Changes **2 files changed** (+8 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/importers/ynab4.ts` (+4 -2) 📝 `packages/loot-core/src/server/importers/ynab5.ts` (+4 -2) </details> ### 📄 Description YNAB exports can contain transactions with empty payee fields. When importing these budgets, the import fails with a generic "unknown" error because `createPayee()` requires a non-empty name field, throwing a `ValidationError` that bubbles up uncaught. **Changes** - Skip importing payees with empty/null names in `importPayees()` for both YNAB4 and YNAB5 importers - Normalize empty `imported_payee` values to `null` in transaction mapping to prevent storing empty strings Transactions referencing skipped payees will have `payee: null`, which the transaction import system already handles correctly. ```typescript // Before: would attempt to create payee and fail for (const payee of data.payees) { if (!payee.deleted) { await actual.createPayee({ name: payee.name }); } } // After: skip invalid payees for (const payee of data.payees) { if (!payee.deleted && payee.name && payee.name.trim() !== '') { await actual.createPayee({ name: payee.name }); } } ``` <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Bug]: Empty payee field prevents import</issue_title> > <issue_description>### Verified issue does not already exist? > > - [x] I have searched and found no existing issue > > ### What happened? > > My nYNAB import was failing with the message "unknown" and no other info. After much troubleshooting I found that I had a very old transaction that had the payee name in the memo field and nothing in the payee field. Once I swapped those the import completed successfully. > > ### How can we reproduce the issue? > > Attempt an nYNAB import with a blank payee name on a transaction. > > Tested on Docker version 25.12.0 and https://app.actualbudget.org/. > > ### Where are you hosting Actual? > > Docker > > ### What browsers are you seeing the problem on? > > Chrome > > ### Operating System > > Mac OSX</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes actualbudget/actual#6441 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --- <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-04-16 18:25:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#25163