From da74e668c8a0b393c00e224c5885dfed4add65e9 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Fri, 2 Jan 2026 18:34:45 +0100 Subject: [PATCH] Fix entry_id mismatch between castle links and exp/rcv links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass entry_id from views_api.py to format_expense_entry and format_receivable_entry so that all links use the same ID: - ^castle-{entry_id} - ^exp-{entry_id} / ^rcv-{entry_id} - entry-id metadata Previously, views_api.py generated an entry_id for castle-* links but didn't pass it to the format functions, which generated their own separate IDs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- views_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views_api.py b/views_api.py index fdb3c18..ffa02f4 100644 --- a/views_api.py +++ b/views_api.py @@ -1125,7 +1125,8 @@ async def api_create_expense_entry( is_equity=data.is_equity, fiat_currency=fiat_currency, fiat_amount=fiat_amount, - reference=castle_reference # Add castle ID as link + reference=castle_reference, + entry_id=entry_id # Pass entry_id so all links match ) # Submit to Fava @@ -1252,7 +1253,8 @@ async def api_create_receivable_entry( entry_date=datetime.now().date(), fiat_currency=fiat_currency, fiat_amount=fiat_amount, - reference=castle_reference # Use castle reference with unique ID + reference=castle_reference, + entry_id=entry_id # Pass entry_id so all links match ) # Submit to Fava