blnkfinance/blnk

Balance metadata on typesense is empty after recording a transaction with the balance.

クローズ

#256 opened on 2026/02/13

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Go (129 件のフォーク)auto 404
buggood first issue

Repository metrics

Stars
 (475 個のスター)
PR merge metrics
 (平均マージ 4d 8h) (30d で 14 merged PRs)

説明

Describe the bug When a balance performs a transaction, the Typesense upsert does not include the metadata field. As a result, when the balance is reindexed after the transaction, the existing metadata in Typesense is overwritten and becomes empty.

To Reproduce Steps to reproduce the behavior:

  1. Create two new balances:
curl -X POST 'http://localhost:5001/balances' \
-d '{
  "ledger_id": "general_ledger_id",
  "currency": "USD",
  "meta_data": {
    "field": "test_value"
  }
}'
  1. Call search to confirm that the balances are indexed with the metadata
curl -X POST 'http://localhost:5001/search/balances' \
-d '{ "q": "*" }'
  1. Create a transaction between both balances.
curl -X POST 'http://localhost:5001/transactions
-d '{
    "amount": 12091.12,
    "currency": "USD",
    "precision": 100,
    "reference": "ref-001",
    "source": "bln_19c0bcd8-e136-4a89-91b3-5be4066b68c4",
    "destination": "bln_a603ab29-7f3d-40f9-9752-8f04e197ddd9",
    "description": "Bug test",
    "allow_overdraft": true
}'
  1. Check the balances via Search again.
  2. You'll see that the balances' metadata is now empty/overwritten although other fields are correct.

Expected behavior The metadata should persist when updating a balance record in Typesense after creating a transaction.

コントリビューターガイド