[PR #7511] fix(transactions): show 'Date is a required field' error when adding without date #49039

Open
opened 2026-04-26 10:54:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7511
Author: @tmchow
Created: 4/15/2026
Status: 🔄 Open

Base: masterHead: fix/7424-transaction-date-required-error


📝 Commits (2)

  • 62a05f4 fix: show consistent 'Date is a required field' error in add transaction
  • 858d79b fix: prevent empty date from reaching server when clearing date input

📊 Changes

2 files changed (+15 additions, -5 deletions)

View changed files

📝 packages/desktop-client/src/components/select/DateSelect.tsx (+9 -5)
upcoming-release-notes/7511.md (+6 -0)

📄 Description

Description

When adding a new transaction, clearing the date field and clicking Add caused a generic "Something internally went wrong" error instead of a helpful message or graceful recovery.

Root cause: DateSelect's blur handler called onSelect('') when the input was empty, which propagated an empty-string date through the cell save handler directly to the server. The server rejected '' as an invalid date and emitted server-error. This happened on the blur path (before the Add button's shouldAdd logic ran), so frontend validation guards in TransactionsTable never had a chance to catch it.

Fix: Changed DateSelect's empty-input blur behavior to restore the previously selected valid date instead of saving ''. This prevents the invalid value from ever reaching the cell save handler or the server. The transaction saves normally with the restored date.

This is a narrower, more correct fix than adding validation in TransactionsTable (which was my v1 approach that @matt-fidd correctly reported didn't work).

Fixes #7424

Testing

  1. Start the web client locally (yarn start).
  2. Open any account, click "Add New".
  3. Clear the date field (Cmd+A, Backspace), then click Add.
  4. Before this change: "Something internally went wrong" error notification.
  5. After this change: Date restores to the previous valid value, transaction saves normally. No error.
  6. Regression check: Normal add-transaction flow with a valid date still works. Clearing date and tabbing away (without clicking Add) also restores the date correctly.

Checklist

  • Release notes added (see link above) — upcoming-release-notes/7511.md
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Compound Engineering


🔄 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/7511 **Author:** [@tmchow](https://github.com/tmchow) **Created:** 4/15/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/7424-transaction-date-required-error` --- ### 📝 Commits (2) - [`62a05f4`](https://github.com/actualbudget/actual/commit/62a05f457e8981e4b076d603a5aef7b02df60677) fix: show consistent 'Date is a required field' error in add transaction - [`858d79b`](https://github.com/actualbudget/actual/commit/858d79b7d18300ea450b601dfb0c61109028cc5b) fix: prevent empty date from reaching server when clearing date input ### 📊 Changes **2 files changed** (+15 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/select/DateSelect.tsx` (+9 -5) ➕ `upcoming-release-notes/7511.md` (+6 -0) </details> ### 📄 Description ## Description When adding a new transaction, clearing the date field and clicking Add caused a generic "Something internally went wrong" error instead of a helpful message or graceful recovery. **Root cause:** `DateSelect`'s blur handler called `onSelect('')` when the input was empty, which propagated an empty-string date through the cell save handler directly to the server. The server rejected `''` as an invalid date and emitted `server-error`. This happened on the blur path (before the Add button's `shouldAdd` logic ran), so frontend validation guards in `TransactionsTable` never had a chance to catch it. **Fix:** Changed `DateSelect`'s empty-input blur behavior to restore the previously selected valid date instead of saving `''`. This prevents the invalid value from ever reaching the cell save handler or the server. The transaction saves normally with the restored date. This is a narrower, more correct fix than adding validation in `TransactionsTable` (which was my v1 approach that @matt-fidd correctly reported didn't work). ## Related issue(s) Fixes #7424 ## Testing 1. Start the web client locally (`yarn start`). 2. Open any account, click "Add New". 3. Clear the date field (Cmd+A, Backspace), then click Add. 4. **Before this change:** "Something internally went wrong" error notification. 5. **After this change:** Date restores to the previous valid value, transaction saves normally. No error. 6. **Regression check:** Normal add-transaction flow with a valid date still works. Clearing date and tabbing away (without clicking Add) also restores the date correctly. ## Checklist - [x] Release notes added (see link above) — `upcoming-release-notes/7511.md` - [x] No obvious regressions in affected areas - [x] Self-review has been performed - I understand what each change in the code does and why it is needed [![Compound Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin) --- <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-26 10:54:04 -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#49039