fix(fusion_accounting_bank_rec): acceptSuggestion double-decrement count
Optimistic remove was decrementing unreconciledCount before assigning the authoritative server count, leading to off-by-one. Order swapped: remove first, then overwrite with server count. Caught by Task 28 subagent self-review. Made-with: Cursor
This commit is contained in:
@@ -149,9 +149,8 @@ export class BankReconciliationService {
|
|||||||
const result = await this.rpc(`${ENDPOINT_BASE}/accept_suggestion`, {
|
const result = await this.rpc(`${ENDPOINT_BASE}/accept_suggestion`, {
|
||||||
suggestion_id: suggestionId,
|
suggestion_id: suggestionId,
|
||||||
});
|
});
|
||||||
this.state.unreconciledCount = result.unreconciled_count_after;
|
|
||||||
// Optimistic remove from list
|
|
||||||
this._removeReconciledLineFromState(this.state.selectedLineId);
|
this._removeReconciledLineFromState(this.state.selectedLineId);
|
||||||
|
this.state.unreconciledCount = result.unreconciled_count_after;
|
||||||
this.notification.add("Reconciliation accepted", { type: "success" });
|
this.notification.add("Reconciliation accepted", { type: "success" });
|
||||||
return result;
|
return result;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user