0xMiden / 0xMiden/web-sdk

upsert_transaction_record script insert and record upsert are separate transactions, can orphan script data

Đang mở
#216 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
1
Fork
21
Merge trung bình
12 giờ 14 phút
Pull request đã merge (30 ngày)
41

Mô tả

## Bug

`upsert_transaction_record` in `crates/idxdb-store/src/transaction/utils.rs` first inserts the transaction script via `idxdb_insert_transaction_script`, then upserts the transaction record via `idxdb_upsert_transaction_record`. These are two separate Dexie transactions.

If the second call fails, the script is stored with no corresponding transaction record referencing it. This orphaned script data accumulates in IndexedDB and is never cleaned up.

## Impact

- Orphaned script data in IndexedDB that is never reclaimed
- Low severity (no data corruption), but violates atomicity expectations

## Root cause

No wrapping transaction. Same pattern as the `upsert_account_storage` bug (separate issue).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

The bug is in crates/idxdb-store/src/transaction/utils.rs in the upsert_transaction_record function. Examine the two separate Dexie transaction calls: idxdb_insert_transaction_script and idxdb_upsert_transaction_record. Understand how IndexedDB transactions work in this SDK. The fix is to wrap both operations in a single transaction. Check for similar patterns like the referenced upsert_account_storage bug to ensure consistency.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust, typescript
Lĩnh vực
backend, databases
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
65/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.