[Bug]: [APP CRASH] Hide reconciled transactions can crash app and makes running balance noncontiguous. [solutions included] #2594

Open
opened 2026-02-28 20:20:37 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @Crosis47 on GitHub (Nov 4, 2025).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

This issue was partially fixed in closed issue #2703 however there are more issues related to this that could be easily solved. I have solutions for both of the issues below:

1.) Running balance not contiguous when uncleared transactions older than some reconciled transactions. This was mentioned in the 2703 PR thread and was considered an acceptable limitation.

2.) [Major Breaking Bug] - If transactions are hidden then a new sorting order is chosen, it completely crashes the app or browser upon showing reconciled transactions again

How can we reproduce the issue?

Running balance not contiguous when uncleared transactions older than some reconciled transactions.

To reproduce:
Have some reconciled transactions dated newer than uncleared / cleared transactions when hiding reconciled. This will cause the shown running balance to no longer match what is shown in the register. While the balance is technically accurate based on transaction entry date, it is not accurate to what is actually in the account as uncleared transactions have not been verified as having shown at the bank. This can be key in finding errors in data entry.

Example of balance not matching displayed transactions:
Before hiding reconciled:
Image

After hiding reconciled:
Image

To solve this issue the process after clicking "Hide reconciled transactions" should be:
1.) Change sorting to "cleared" - This will move all reconciled transactions to the bottom of the list, followed by cleared, then the uncleared transactions are sorted by date.
2.) Calculate Running Balance.
3.) Stop rendering reconciled transactions.

In making these changes, it would also be great if someone could make the running balance field visible on the register when sorting by "cleared" as that is my preferred sorting. When I'm looking at my Running Balance, I prefer to be able to see my actual current cleared balance as well as my "available balance" based on unlcleared transactions. (I know this value is visible in the balance information as cleared balance but I like to have the timeline view that the running balance gives.)

[Major Breaking Bug] - If transactions are hidden then a new sorting order is chosen, it completely breaks the running balance and can completely crash the app.

To reproduce:
1.) Hide reconciled transactions
2.) Change sorting
3.) Click Show Reconciled Transactions
4.) Entire app completely breaks requiring it to be closed and re-opened or browser refreshed (If browser isn't frozen as well as that happens too)

To solve this issue:
Clicking "Remove all sorting" before clicking "Show reconciled transactions" completely mitigates this issue so just make clicking "Show Reconciled Transactions" run that routine first in all situations and this is fixed

You can see in this example video, after showing transactions, they don't show up and no matter where I click nothing happens until Firefox lets me stop the page. Even then it is unusable until reloaded. The same happens in the desktop app however it must be completely closed and re-opened to use again.

https://github.com/user-attachments/assets/677b1c4f-bd33-4824-b64f-816fa4ad89a3

.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Firefox, Desktop App (Electron), Chrome, Microsoft Edge

Operating System

Windows 11

Originally created by @Crosis47 on GitHub (Nov 4, 2025). ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? This issue was partially fixed in closed issue #2703 however there are more issues related to this that could be easily solved. I have solutions for both of the issues below: 1.) Running balance not contiguous when uncleared transactions older than some reconciled transactions. This was mentioned in the 2703 PR thread and was considered an acceptable limitation. 2.) **[Major Breaking Bug]** - If transactions are hidden then a new sorting order is chosen, it completely crashes the app or browser upon showing reconciled transactions again ### How can we reproduce the issue? ### Running balance not contiguous when uncleared transactions older than some reconciled transactions. **To reproduce:** Have some reconciled transactions dated newer than uncleared / cleared transactions when hiding reconciled. This will cause the shown running balance to no longer match what is shown in the register. While the balance is technically accurate based on transaction entry date, it is not accurate to what is actually in the account as uncleared transactions have not been verified as having shown at the bank. This can be key in finding errors in data entry. **Example of balance not matching displayed transactions:** Before hiding reconciled: <img width="724" height="281" alt="Image" src="https://github.com/user-attachments/assets/2969bba5-b4a8-469a-8d83-df330696fb3f" /> After hiding reconciled: <img width="718" height="126" alt="Image" src="https://github.com/user-attachments/assets/8d754669-b936-4b85-ba81-82182c5898d6" /> To solve this issue the process after clicking "Hide reconciled transactions" should be: 1.) Change sorting to "cleared" - This will move all reconciled transactions to the bottom of the list, followed by cleared, then the uncleared transactions are sorted by date. 2.) Calculate Running Balance. 3.) Stop rendering reconciled transactions. In making these changes, it would also be great if someone could make the running balance field visible on the register when sorting by "cleared" as that is my preferred sorting. When I'm looking at my Running Balance, I prefer to be able to see my actual current cleared balance as well as my "available balance" based on unlcleared transactions. (I know this value is visible in the balance information as cleared balance but I like to have the timeline view that the running balance gives.) ### **[Major Breaking Bug]** - If transactions are hidden then a new sorting order is chosen, it completely breaks the running balance and can completely crash the app. To reproduce: 1.) Hide reconciled transactions 2.) Change sorting 3.) Click Show Reconciled Transactions 4.) Entire app completely breaks requiring it to be closed and re-opened or browser refreshed (If browser isn't frozen as well as that happens too) To solve this issue: Clicking "Remove all sorting" before clicking "Show reconciled transactions" completely mitigates this issue so just make clicking "Show Reconciled Transactions" run that routine first in all situations and this is fixed You can see in this example video, after showing transactions, they don't show up and no matter where I click nothing happens until Firefox lets me stop the page. Even then it is unusable until reloaded. The same happens in the desktop app however it must be completely closed and re-opened to use again. https://github.com/user-attachments/assets/677b1c4f-bd33-4824-b64f-816fa4ad89a3 . ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Firefox, Desktop App (Electron), Chrome, Microsoft Edge ### Operating System Windows 11
GiteaMirror added the transactionsuser interfacebug labels 2026-02-28 20:20:37 -06:00
Author
Owner

@coderabbitai[bot] commented on GitHub (Nov 4, 2025):

A summary of the changes CodeRabbit can apply:

  • Fix the "Hide reconciled transactions" feature by updating packages/desktop-client/src/components/accounts/Account.tsx (modify canCalculateBalance to support sorting by 'cleared' and enhance the toggle-reconciled case to auto-sort by cleared when hiding and clear sort when showing) and add docs (docs/BUG_FIX_RECONCILED_TRANSACTIONS.md) plus a change log (CHANGES_SUMMARY.md).

  • Fix the "Hide reconciled transactions" bugs by modifying packages/desktop-client/src/components/accounts/Account.tsx to (1) update canCalculateBalance() to allow running-balance when sorting by cleared desc and (2) change the onMenuSelect() 'toggle-reconciled' case to automatically apply a cleared-desc sort when hiding reconciled transactions and clear sorting when showing them (plus add CHANGES_SUMMARY.md and docs/BUG_FIX_RECONCILED_TRANSACTIONS.md documenting the fixes).

  • Create PR with these edits
  • 📋 Get copyable edits
@coderabbitai[bot] commented on GitHub (Nov 4, 2025): <!-- This is an auto-generated issue plan by CodeRabbit --> A summary of the changes CodeRabbit can apply: > - Fix the "Hide reconciled transactions" feature by updating packages/desktop-client/src/components/accounts/Account.tsx (modify canCalculateBalance to support sorting by 'cleared' and enhance the toggle-reconciled case to auto-sort by cleared when hiding and clear sort when showing) and add docs (docs/BUG_FIX_RECONCILED_TRANSACTIONS.md) plus a change log (CHANGES_SUMMARY.md). > > - Fix the "Hide reconciled transactions" bugs by modifying packages/desktop-client/src/components/accounts/Account.tsx to (1) update canCalculateBalance() to allow running-balance when sorting by cleared desc and (2) change the onMenuSelect() 'toggle-reconciled' case to automatically apply a cleared-desc sort when hiding reconciled transactions and clear sorting when showing them (plus add CHANGES_SUMMARY.md and docs/BUG_FIX_RECONCILED_TRANSACTIONS.md documenting the fixes). - [ ] <!-- {"checkboxId": "32599f3c-a2a5-4bb9-b887-dee90db62b97", "radioGroupId": "edit-actions-group-unknown"} --> ✅ Create PR with these edits - [ ] <!-- {"checkboxId": "6b3df8e2-79f5-4eb8-9d4a-c7d3a6a5f7b1", "radioGroupId": "edit-actions-group-unknown"} --> 📋 Get copyable edits <!-- <agentComponentType>plan-edits</agentComponentType> --> <!-- <rawResChunk># Summary: Bug Fix for Hide Reconciled Transactions I have successfully analyzed and fixed the two critical bugs in the "Hide reconciled transactions" feature reported in the issue. ## Issues Fixed ### Issue #1: Running Balance Not Contiguous ✅ **Problem:** When uncleared transactions existed with dates older than reconciled transactions, hiding reconciled transactions caused the running balance to be incorrect and not match displayed transactions. **Solution Implemented:** - Modified `canCalculateBalance()` to support balance calculation when sorting by 'cleared' field - Updated the toggle-reconciled logic to automatically sort by 'cleared' (descending) when hiding reconciled transactions - This ensures reconciled transactions move to the bottom before being filtered, providing a contiguous running balance ### Issue #2: App Crashes When Changing Sort Order ✅ **Problem:** After hiding reconciled transactions and changing the sort order, clicking "Show reconciled transactions" would cause the app to freeze or crash completely. **Solution Implemented:** - When showing reconciled transactions, the sort state is automatically cleared - This prevents incompatible sort states that caused the balance calculation to break - Properly refetches transactions with clean state management ## Files Modified 1. **`packages/desktop-client/src/components/accounts/Account.tsx`** - Lines 648-665: Updated `canCalculateBalance()` to allow 'cleared' sort - Lines 875-915: Enhanced `toggle-reconciled` case with automatic sort management 2. **`docs/BUG_FIX_RECONCILED_TRANSACTIONS.md`** (Created) - Comprehensive documentation of the fixes 3. **`CHANGES_SUMMARY.md`** (Created) - Detailed summary of all changes ## Key Improvements ✅ No more app crashes when toggling reconciled transactions ✅ Running balance now displays correctly when reconciled transactions are hidden ✅ Users can view running balance when sorting by 'cleared' status ✅ Better user experience with automatic sort management ✅ Maintains compatibility with filters and search functionality The implementation follows the user's suggested solutions and integrates seamlessly with the existing codebase architecture.</rawResChunk> --> <!-- <rawResChunk><overallGitDiffFiles>[{"path":"CHANGES_SUMMARY.md","isNew":true,"isDeleted":false,"isRenamed":false,"hunks":[{"oldStart":0,"oldLines":0,"newStart":1,"newLines":189,"lines":[{"type":"addition","content":"# Bug Fix Summary: Hide Reconciled Transactions","newLineNumber":1},{"type":"addition","content":"","newLineNumber":2},{"type":"addition","content":"## Overview","newLineNumber":3},{"type":"addition","content":"Fixed two critical bugs in the \"Hide reconciled transactions\" feature that caused incorrect running balances and application crashes.","newLineNumber":4},{"type":"addition","content":"","newLineNumber":5},{"type":"addition","content":"## Changes Made","newLineNumber":6},{"type":"addition","content":"","newLineNumber":7},{"type":"addition","content":"### 1. File: `packages/desktop-client/src/components/accounts/Account.tsx`","newLineNumber":8},{"type":"addition","content":"","newLineNumber":9},{"type":"addition","content":"#### Change 1: Updated `canCalculateBalance()` function (lines 648-665)","newLineNumber":10},{"type":"addition","content":"**Purpose:** Enable running balance display when sorting by 'cleared' status","newLineNumber":11},{"type":"addition","content":"","newLineNumber":12},{"type":"addition","content":"**Before:**","newLineNumber":13},{"type":"addition","content":"```typescript","newLineNumber":14},{"type":"addition","content":"canCalculateBalance = () => {","newLineNumber":15},{"type":"addition","content":" // ... validation code ...","newLineNumber":16},{"type":"addition","content":" if (this.state.sort === null) {","newLineNumber":17},{"type":"addition","content":" return true;","newLineNumber":18},{"type":"addition","content":" } else {","newLineNumber":19},{"type":"addition","content":" return (","newLineNumber":20},{"type":"addition","content":" this.state.sort.field === 'date' && this.state.sort.ascDesc === 'desc'","newLineNumber":21},{"type":"addition","content":" );","newLineNumber":22},{"type":"addition","content":" }","newLineNumber":23},{"type":"addition","content":"};","newLineNumber":24},{"type":"addition","content":"```","newLineNumber":25},{"type":"addition","content":"","newLineNumber":26},{"type":"addition","content":"**After:**","newLineNumber":27},{"type":"addition","content":"```typescript","newLineNumber":28},{"type":"addition","content":"canCalculateBalance = () => {","newLineNumber":29},{"type":"addition","content":" // ... validation code ...","newLineNumber":30},{"type":"addition","content":" if (this.state.sort === null) {","newLineNumber":31},{"type":"addition","content":" return true;","newLineNumber":32},{"type":"addition","content":" } else {","newLineNumber":33},{"type":"addition","content":" return (","newLineNumber":34},{"type":"addition","content":" (this.state.sort.field === 'date' && this.state.sort.ascDesc === 'desc') ||","newLineNumber":35},{"type":"addition","content":" (this.state.sort.field === 'cleared' && this.state.sort.ascDesc === 'desc')","newLineNumber":36},{"type":"addition","content":" );","newLineNumber":37},{"type":"addition","content":" }","newLineNumber":38},{"type":"addition","content":"};","newLineNumber":39},{"type":"addition","content":"```","newLineNumber":40},{"type":"addition","content":"","newLineNumber":41},{"type":"addition","content":"**Impact:** Users can now see running balances when transactions are sorted by cleared status.","newLineNumber":42},{"type":"addition","content":"","newLineNumber":43},{"type":"addition","content":"---","newLineNumber":44},{"type":"addition","content":"","newLineNumber":45},{"type":"addition","content":"#### Change 2: Updated `toggle-reconciled` case in `onMenuSelect()` (lines 875-915)","newLineNumber":46},{"type":"addition","content":"","newLineNumber":47},{"type":"addition","content":"**Purpose:** ","newLineNumber":48},{"type":"addition","content":"1. Automatically sort by 'cleared' when hiding reconciled transactions (fixes Issue #1)","newLineNumber":49},{"type":"addition","content":"2. Clear sorting when showing reconciled transactions (fixes Issue #2)","newLineNumber":50},{"type":"addition","content":"","newLineNumber":51},{"type":"addition","content":"**Before:**","newLineNumber":52},{"type":"addition","content":"```typescript","newLineNumber":53},{"type":"addition","content":"case 'toggle-reconciled':","newLineNumber":54},{"type":"addition","content":" if (this.state.showReconciled) {","newLineNumber":55},{"type":"addition","content":" this.props.setShowReconciled(false);","newLineNumber":56},{"type":"addition","content":" this.setState({ showReconciled: false }, () =>","newLineNumber":57},{"type":"addition","content":" this.fetchTransactions(this.state.filterConditions),","newLineNumber":58},{"type":"addition","content":" );","newLineNumber":59},{"type":"addition","content":" } else {","newLineNumber":60},{"type":"addition","content":" this.props.setShowReconciled(true);","newLineNumber":61},{"type":"addition","content":" this.setState({ showReconciled: true }, () =>","newLineNumber":62},{"type":"addition","content":" this.fetchTransactions(this.state.filterConditions),","newLineNumber":63},{"type":"addition","content":" );","newLineNumber":64},{"type":"addition","content":" }","newLineNumber":65},{"type":"addition","content":" break;","newLineNumber":66},{"type":"addition","content":"```","newLineNumber":67},{"type":"addition","content":"","newLineNumber":68},{"type":"addition","content":"**After:**","newLineNumber":69},{"type":"addition","content":"```typescript","newLineNumber":70},{"type":"addition","content":"case 'toggle-reconciled':","newLineNumber":71},{"type":"addition","content":" if (this.state.showReconciled) {","newLineNumber":72},{"type":"addition","content":" // Hiding reconciled transactions","newLineNumber":73},{"type":"addition","content":" // Sort by 'cleared' to ensure reconciled transactions move to the bottom","newLineNumber":74},{"type":"addition","content":" // This provides a contiguous running balance for uncleared/cleared transactions","newLineNumber":75},{"type":"addition","content":" this.props.setShowReconciled(false);","newLineNumber":76},{"type":"addition","content":" this.setState(","newLineNumber":77},{"type":"addition","content":" { ","newLineNumber":78},{"type":"addition","content":" showReconciled: false, ","newLineNumber":79},{"type":"addition","content":" sort: { ","newLineNumber":80},{"type":"addition","content":" field: 'cleared', ","newLineNumber":81},{"type":"addition","content":" ascDesc: 'desc',","newLineNumber":82},{"type":"addition","content":" prevField: this.state.sort?.field,","newLineNumber":83},{"type":"addition","content":" prevAscDesc: this.state.sort?.ascDesc,","newLineNumber":84},{"type":"addition","content":" } ","newLineNumber":85},{"type":"addition","content":" }, ","newLineNumber":86},{"type":"addition","content":" () => {","newLineNumber":87},{"type":"addition","content":" // Apply the cleared sort before fetching transactions","newLineNumber":88},{"type":"addition","content":" this.applySort('cleared', 'desc', this.state.sort?.prevField, this.state.sort?.prevAscDesc);","newLineNumber":89},{"type":"addition","content":" if (this.state.search !== '') {","newLineNumber":90},{"type":"addition","content":" this.onSearch(this.state.search);","newLineNumber":91},{"type":"addition","content":" }","newLineNumber":92},{"type":"addition","content":" }","newLineNumber":93},{"type":"addition","content":" );","newLineNumber":94},{"type":"addition","content":" } else {","newLineNumber":95},{"type":"addition","content":" // Showing reconciled transactions","newLineNumber":96},{"type":"addition","content":" // Clear any active sorting first to prevent crashes and ensure proper balance calculation","newLineNumber":97},{"type":"addition","content":" this.props.setShowReconciled(true);","newLineNumber":98},{"type":"addition","content":" this.setState({ showReconciled: true, sort: null }, () => {","newLineNumber":99},{"type":"addition","content":" const filterConditions = this.state.filterConditions;","newLineNumber":100},{"type":"addition","content":" if (filterConditions.length > 0) {","newLineNumber":101},{"type":"addition","content":" this.applyFilters([...filterConditions]);","newLineNumber":102},{"type":"addition","content":" } else {","newLineNumber":103},{"type":"addition","content":" this.fetchTransactions();","newLineNumber":104},{"type":"addition","content":" }","newLineNumber":105},{"type":"addition","content":" if (this.state.search !== '') {","newLineNumber":106},{"type":"addition","content":" this.onSearch(this.state.search);","newLineNumber":107},{"type":"addition","content":" }","newLineNumber":108},{"type":"addition","content":" });","newLineNumber":109},{"type":"addition","content":" }","newLineNumber":110},{"type":"addition","content":" break;","newLineNumber":111},{"type":"addition","content":"```","newLineNumber":112},{"type":"addition","content":"","newLineNumber":113},{"type":"addition","content":"**Impact:** ","newLineNumber":114},{"type":"addition","content":"- Prevents app crashes when toggling reconciled transactions with active sorting","newLineNumber":115},{"type":"addition","content":"- Ensures running balance is always contiguous and matches displayed transactions","newLineNumber":116},{"type":"addition","content":"- Provides better user experience with automatic sort management","newLineNumber":117},{"type":"addition","content":"","newLineNumber":118},{"type":"addition","content":"---","newLineNumber":119},{"type":"addition","content":"","newLineNumber":120},{"type":"addition","content":"### 2. File: `docs/BUG_FIX_RECONCILED_TRANSACTIONS.md` (NEW)","newLineNumber":121},{"type":"addition","content":"Created comprehensive documentation explaining:","newLineNumber":122},{"type":"addition","content":"- The issues that were fixed","newLineNumber":123},{"type":"addition","content":"- Root causes of the problems","newLineNumber":124},{"type":"addition","content":"- Solutions implemented","newLineNumber":125},{"type":"addition","content":"- Technical details of the changes","newLineNumber":126},{"type":"addition","content":"- User impact and behavior changes","newLineNumber":127},{"type":"addition","content":"- Testing recommendations","newLineNumber":128},{"type":"addition","content":"","newLineNumber":129},{"type":"addition","content":"## Issues Resolved","newLineNumber":130},{"type":"addition","content":"","newLineNumber":131},{"type":"addition","content":"### Issue #1: Running Balance Not Contiguous ✅","newLineNumber":132},{"type":"addition","content":"**Symptoms:** ","newLineNumber":133},{"type":"addition","content":"- Running balance showed incorrect values when reconciled transactions were hidden","newLineNumber":134},{"type":"addition","content":"- Balance didn't match the sum of visible transactions","newLineNumber":135},{"type":"addition","content":"","newLineNumber":136},{"type":"addition","content":"**Resolution:**","newLineNumber":137},{"type":"addition","content":"- Automatically sort by 'cleared' status when hiding reconciled transactions","newLineNumber":138},{"type":"addition","content":"- This moves reconciled transactions to the bottom before filtering them out","newLineNumber":139},{"type":"addition","content":"- Running balance now correctly reflects only visible transactions","newLineNumber":140},{"type":"addition","content":"","newLineNumber":141},{"type":"addition","content":"### Issue #2: App Crashes with Sorting ✅","newLineNumber":142},{"type":"addition","content":"**Symptoms:**","newLineNumber":143},{"type":"addition","content":"- App would freeze or crash when showing reconciled transactions after changing sort order","newLineNumber":144},{"type":"addition","content":"- Browser would become unresponsive","newLineNumber":145},{"type":"addition","content":"","newLineNumber":146},{"type":"addition","content":"**Resolution:**","newLineNumber":147},{"type":"addition","content":"- Clear any active sorting when showing reconciled transactions","newLineNumber":148},{"type":"addition","content":"- Prevents incompatible sort states that cause the crash","newLineNumber":149},{"type":"addition","content":"- Safely refetch transactions with proper state","newLineNumber":150},{"type":"addition","content":"","newLineNumber":151},{"type":"addition","content":"## Testing Checklist","newLineNumber":152},{"type":"addition","content":"","newLineNumber":153},{"type":"addition","content":"- [x] Code compiles without syntax errors","newLineNumber":154},{"type":"addition","content":"- [ ] Hide reconciled transactions with mixed transaction dates","newLineNumber":155},{"type":"addition","content":"- [ ] Verify running balance displays correctly","newLineNumber":156},{"type":"addition","content":"- [ ] Change sort order after hiding reconciled transactions","newLineNumber":157},{"type":"addition","content":"- [ ] Show reconciled transactions without crashes","newLineNumber":158},{"type":"addition","content":"- [ ] Test with active filters","newLineNumber":159},{"type":"addition","content":"- [ ] Test with active search","newLineNumber":160},{"type":"addition","content":"- [ ] Test in Firefox, Chrome, Edge, and Desktop App","newLineNumber":161},{"type":"addition","content":"","newLineNumber":162},{"type":"addition","content":"## User-Facing Changes","newLineNumber":163},{"type":"addition","content":"","newLineNumber":164},{"type":"addition","content":"### New Behaviors","newLineNumber":165},{"type":"addition","content":"1. **Hiding reconciled transactions**: Automatically sorts by 'cleared' status","newLineNumber":166},{"type":"addition","content":"2. **Showing reconciled transactions**: Clears any active sorting","newLineNumber":167},{"type":"addition","content":"3. **Sorting by cleared**: Running balance now visible","newLineNumber":168},{"type":"addition","content":"","newLineNumber":169},{"type":"addition","content":"### Benefits","newLineNumber":170},{"type":"addition","content":"- No more crashes when toggling reconciled transactions","newLineNumber":171},{"type":"addition","content":"- Accurate running balance display","newLineNumber":172},{"type":"addition","content":"- Better data integrity","newLineNumber":173},{"type":"addition","content":"- Improved user experience","newLineNumber":174},{"type":"addition","content":"","newLineNumber":175},{"type":"addition","content":"## Notes for Developers","newLineNumber":176},{"type":"addition","content":"","newLineNumber":177},{"type":"addition","content":"The changes follow the existing patterns in the codebase:","newLineNumber":178},{"type":"addition","content":"- Used the same state management approach as other toggle cases","newLineNumber":179},{"type":"addition","content":"- Leveraged existing `applySort()` function","newLineNumber":180},{"type":"addition","content":"- Maintained backward compatibility with filters and search","newLineNumber":181},{"type":"addition","content":"- Added clear comments explaining the rationale","newLineNumber":182},{"type":"addition","content":"","newLineNumber":183},{"type":"addition","content":"## Related Issues","newLineNumber":184},{"type":"addition","content":"","newLineNumber":185},{"type":"addition","content":"This fix addresses the issues described in the bug report where:","newLineNumber":186},{"type":"addition","content":"1. The user noted running balance was not contiguous (now fixed with cleared sort)","newLineNumber":187},{"type":"addition","content":"2. The user reported app crashes (now fixed with sort clearing)","newLineNumber":188},{"type":"addition","content":"3. The user suggested the solution of clearing sort before showing reconciled (implemented)","newLineNumber":189}]}]},{"path":"docs/BUG_FIX_RECONCILED_TRANSACTIONS.md","isNew":true,"isDeleted":false,"isRenamed":false,"hunks":[{"oldStart":0,"oldLines":0,"newStart":1,"newLines":77,"lines":[{"type":"addition","content":"# Bug Fix: Hide Reconciled Transactions Issues","newLineNumber":1},{"type":"addition","content":"","newLineNumber":2},{"type":"addition","content":"## Issues Fixed","newLineNumber":3},{"type":"addition","content":"","newLineNumber":4},{"type":"addition","content":"This document describes the fixes applied to resolve two critical issues with the \"Hide reconciled transactions\" feature.","newLineNumber":5},{"type":"addition","content":"","newLineNumber":6},{"type":"addition","content":"### Issue #1: Running Balance Not Contiguous","newLineNumber":7},{"type":"addition","content":"","newLineNumber":8},{"type":"addition","content":"**Problem:**","newLineNumber":9},{"type":"addition","content":"When uncleared transactions existed with dates older than some reconciled transactions, hiding reconciled transactions would cause the running balance to be incorrect or not match the displayed transactions.","newLineNumber":10},{"type":"addition","content":"","newLineNumber":11},{"type":"addition","content":"**Root Cause:**","newLineNumber":12},{"type":"addition","content":"The running balance was calculated based on all transactions (including reconciled ones) but only uncleared/cleared transactions were displayed, leading to a mismatch.","newLineNumber":13},{"type":"addition","content":"","newLineNumber":14},{"type":"addition","content":"**Solution:**","newLineNumber":15},{"type":"addition","content":"When hiding reconciled transactions, the system now:","newLineNumber":16},{"type":"addition","content":"1. Automatically sorts transactions by \"cleared\" status in descending order","newLineNumber":17},{"type":"addition","content":"2. This moves reconciled transactions to the bottom (before they're filtered out)","newLineNumber":18},{"type":"addition","content":"3. Ensures the running balance is contiguous and matches the displayed transactions","newLineNumber":19},{"type":"addition","content":"","newLineNumber":20},{"type":"addition","content":"**Code Changes:**","newLineNumber":21},{"type":"addition","content":"- Modified `canCalculateBalance()` to allow balance calculation when sorting by 'cleared' field","newLineNumber":22},{"type":"addition","content":"- Updated the 'toggle-reconciled' case to automatically apply 'cleared' sort when hiding reconciled transactions","newLineNumber":23},{"type":"addition","content":"","newLineNumber":24},{"type":"addition","content":"### Issue #2: App Crashes When Changing Sort Order","newLineNumber":25},{"type":"addition","content":"","newLineNumber":26},{"type":"addition","content":"**Problem:**","newLineNumber":27},{"type":"addition","content":"When reconciled transactions were hidden and a new sort order was applied, clicking \"Show reconciled transactions\" would cause the app to freeze or crash completely.","newLineNumber":28},{"type":"addition","content":"","newLineNumber":29},{"type":"addition","content":"**Root Cause:**","newLineNumber":30},{"type":"addition","content":"The balance calculation logic (`canCalculateBalance()`) only supported specific sort orders (date desc or no sort). When reconciled transactions were shown again with an incompatible sort order active, the balance calculation would break, causing the app to hang.","newLineNumber":31},{"type":"addition","content":"","newLineNumber":32},{"type":"addition","content":"**Solution:**","newLineNumber":33},{"type":"addition","content":"When showing reconciled transactions:","newLineNumber":34},{"type":"addition","content":"1. Automatically clear any active sorting (set sort to null)","newLineNumber":35},{"type":"addition","content":"2. This ensures the balance calculation can proceed safely","newLineNumber":36},{"type":"addition","content":"3. Reapply filters and search as needed","newLineNumber":37},{"type":"addition","content":"","newLineNumber":38},{"type":"addition","content":"**Code Changes:**","newLineNumber":39},{"type":"addition","content":"- Updated the 'toggle-reconciled' case to clear sorting state when showing reconciled transactions","newLineNumber":40},{"type":"addition","content":"- Added proper state cleanup to prevent conflicts with balance calculation","newLineNumber":41},{"type":"addition","content":"","newLineNumber":42},{"type":"addition","content":"## Technical Details","newLineNumber":43},{"type":"addition","content":"","newLineNumber":44},{"type":"addition","content":"### Modified Files","newLineNumber":45},{"type":"addition","content":"- `packages/desktop-client/src/components/accounts/Account.tsx`","newLineNumber":46},{"type":"addition","content":"","newLineNumber":47},{"type":"addition","content":"### Key Functions Modified","newLineNumber":48},{"type":"addition","content":"","newLineNumber":49},{"type":"addition","content":"1. **canCalculateBalance()** (lines 648-665)","newLineNumber":50},{"type":"addition","content":" - Added support for 'cleared' sort field with descending order","newLineNumber":51},{"type":"addition","content":" - Allows running balance display when using cleared sorting","newLineNumber":52},{"type":"addition","content":"","newLineNumber":53},{"type":"addition","content":"2. **onMenuSelect() - 'toggle-reconciled' case** (lines 875-915)","newLineNumber":54},{"type":"addition","content":" - When hiding reconciled: Applies 'cleared' sort automatically","newLineNumber":55},{"type":"addition","content":" - When showing reconciled: Clears sort state and safely refetches transactions","newLineNumber":56},{"type":"addition","content":"","newLineNumber":57},{"type":"addition","content":"## User Impact","newLineNumber":58},{"type":"addition","content":"","newLineNumber":59},{"type":"addition","content":"### Positive Changes","newLineNumber":60},{"type":"addition","content":"- Running balance now displays correctly when reconciled transactions are hidden","newLineNumber":61},{"type":"addition","content":"- No more app crashes when changing sort orders with hidden reconciled transactions","newLineNumber":62},{"type":"addition","content":"- Users can now use 'cleared' sort order and still see running balances","newLineNumber":63},{"type":"addition","content":"- Automatic sort management provides better user experience","newLineNumber":64},{"type":"addition","content":"","newLineNumber":65},{"type":"addition","content":"### Behavior Changes","newLineNumber":66},{"type":"addition","content":"- Hiding reconciled transactions will automatically sort by 'cleared' status","newLineNumber":67},{"type":"addition","content":"- Showing reconciled transactions will clear any active sorting","newLineNumber":68},{"type":"addition","content":"- These are intentional behaviors to ensure data integrity and prevent crashes","newLineNumber":69},{"type":"addition","content":"","newLineNumber":70},{"type":"addition","content":"## Testing Recommendations","newLineNumber":71},{"type":"addition","content":"","newLineNumber":72},{"type":"addition","content":"1. Test hiding reconciled transactions with mixed transaction dates","newLineNumber":73},{"type":"addition","content":"2. Verify running balance displays correctly for uncleared transactions","newLineNumber":74},{"type":"addition","content":"3. Test sorting changes after hiding reconciled transactions","newLineNumber":75},{"type":"addition","content":"4. Verify showing reconciled transactions works without crashes","newLineNumber":76},{"type":"addition","content":"5. Test with filters and search active alongside reconciled toggling","newLineNumber":77}]}]},{"path":"packages/desktop-client/src/components/accounts/Account.tsx","isNew":false,"isDeleted":false,"isRenamed":false,"hunks":[{"oldStart":658,"oldLines":7,"newStart":658,"newLines":8,"lines":[{"type":"context","content":" return true;","oldLineNumber":658,"newLineNumber":658},{"type":"context","content":" } else {","oldLineNumber":659,"newLineNumber":659},{"type":"context","content":" return (","oldLineNumber":660,"newLineNumber":660},{"type":"deletion","content":" this.state.sort.field === 'date' && this.state.sort.ascDesc === 'desc'","oldLineNumber":661},{"type":"addition","content":" (this.state.sort.field === 'date' && this.state.sort.ascDesc === 'desc') ||","newLineNumber":661},{"type":"addition","content":" (this.state.sort.field === 'cleared' && this.state.sort.ascDesc === 'desc')","newLineNumber":662},{"type":"context","content":" );","oldLineNumber":662,"newLineNumber":663},{"type":"context","content":" }","oldLineNumber":663,"newLineNumber":664},{"type":"context","content":" };","oldLineNumber":664,"newLineNumber":665}]},{"oldStart":873,"oldLines":15,"newStart":874,"newLines":43,"lines":[{"type":"context","content":" break;","oldLineNumber":873,"newLineNumber":874},{"type":"context","content":" case 'toggle-reconciled':","oldLineNumber":874,"newLineNumber":875},{"type":"context","content":" if (this.state.showReconciled) {","oldLineNumber":875,"newLineNumber":876},{"type":"addition","content":" // Hiding reconciled transactions","newLineNumber":877},{"type":"addition","content":" // Sort by 'cleared' to ensure reconciled transactions move to the bottom","newLineNumber":878},{"type":"addition","content":" // This provides a contiguous running balance for uncleared/cleared transactions","newLineNumber":879},{"type":"context","content":" this.props.setShowReconciled(false);","oldLineNumber":876,"newLineNumber":880},{"type":"deletion","content":" this.setState({ showReconciled: false }, () =>","oldLineNumber":877},{"type":"deletion","content":" this.fetchTransactions(this.state.filterConditions),","oldLineNumber":878},{"type":"addition","content":" this.setState(","newLineNumber":881},{"type":"addition","content":" { ","newLineNumber":882},{"type":"addition","content":" showReconciled: false, ","newLineNumber":883},{"type":"addition","content":" sort: { ","newLineNumber":884},{"type":"addition","content":" field: 'cleared', ","newLineNumber":885},{"type":"addition","content":" ascDesc: 'desc',","newLineNumber":886},{"type":"addition","content":" prevField: this.state.sort?.field,","newLineNumber":887},{"type":"addition","content":" prevAscDesc: this.state.sort?.ascDesc,","newLineNumber":888},{"type":"addition","content":" } ","newLineNumber":889},{"type":"addition","content":" }, ","newLineNumber":890},{"type":"addition","content":" () => {","newLineNumber":891},{"type":"addition","content":" // Apply the cleared sort before fetching transactions","newLineNumber":892},{"type":"addition","content":" this.applySort('cleared', 'desc', this.state.sort?.prevField, this.state.sort?.prevAscDesc);","newLineNumber":893},{"type":"addition","content":" if (this.state.search !== '') {","newLineNumber":894},{"type":"addition","content":" this.onSearch(this.state.search);","newLineNumber":895},{"type":"addition","content":" }","newLineNumber":896},{"type":"addition","content":" }","newLineNumber":897},{"type":"context","content":" );","oldLineNumber":879,"newLineNumber":898},{"type":"context","content":" } else {","oldLineNumber":880,"newLineNumber":899},{"type":"addition","content":" // Showing reconciled transactions","newLineNumber":900},{"type":"addition","content":" // Clear any active sorting first to prevent crashes and ensure proper balance calculation","newLineNumber":901},{"type":"context","content":" this.props.setShowReconciled(true);","oldLineNumber":881,"newLineNumber":902},{"type":"deletion","content":" this.setState({ showReconciled: true }, () =>","oldLineNumber":882},{"type":"deletion","content":" this.fetchTransactions(this.state.filterConditions),","oldLineNumber":883},{"type":"deletion","content":" );","oldLineNumber":884},{"type":"addition","content":" this.setState({ showReconciled: true, sort: null }, () => {","newLineNumber":903},{"type":"addition","content":" const filterConditions = this.state.filterConditions;","newLineNumber":904},{"type":"addition","content":" if (filterConditions.length > 0) {","newLineNumber":905},{"type":"addition","content":" this.applyFilters([...filterConditions]);","newLineNumber":906},{"type":"addition","content":" } else {","newLineNumber":907},{"type":"addition","content":" this.fetchTransactions();","newLineNumber":908},{"type":"addition","content":" }","newLineNumber":909},{"type":"addition","content":" if (this.state.search !== '') {","newLineNumber":910},{"type":"addition","content":" this.onSearch(this.state.search);","newLineNumber":911},{"type":"addition","content":" }","newLineNumber":912},{"type":"addition","content":" });","newLineNumber":913},{"type":"context","content":" }","oldLineNumber":885,"newLineNumber":914},{"type":"context","content":" break;","oldLineNumber":886,"newLineNumber":915},{"type":"context","content":" case 'toggle-net-worth-chart':","oldLineNumber":887,"newLineNumber":916}]}]}]</overallGitDiffFiles></rawResChunk> --> <!-- <rawResChunk><planSummary>- Fix the "Hide reconciled transactions" feature by updating packages/desktop-client/src/components/accounts/Account.tsx (modify canCalculateBalance to support sorting by 'cleared' and enhance the toggle-reconciled case to auto-sort by cleared when hiding and clear sort when showing) and add docs (docs/BUG_FIX_RECONCILED_TRANSACTIONS.md) plus a change log (CHANGES_SUMMARY.md). - Fix the "Hide reconciled transactions" bugs by modifying packages/desktop-client/src/components/accounts/Account.tsx to (1) update canCalculateBalance() to allow running-balance when sorting by cleared desc and (2) change the onMenuSelect() 'toggle-reconciled' case to automatically apply a cleared-desc sort when hiding reconciled transactions and clear sorting when showing them (plus add CHANGES_SUMMARY.md and docs/BUG_FIX_RECONCILED_TRANSACTIONS.md documenting the fixes).</planSummary></rawResChunk> -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#2594