juspay / juspay/deja

Seed renderer refuses payment_attempt rows: tagged-enum value in a varchar column

Open
#35 2 comments 0 reactions 1 assignee Claimed by @maverox View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
21h 32m
Merged PRs (30d)
67

Description

Confirmed end to end on run `rp-sbx-adf4845317-adf4845-08062232-85-0807082100244` (audit-instrumented stack).

**Mechanism.** Recorded `payment_attempt` rows carry `connector_transaction_id: {"TxnId": "…"}` — `ConnectorTransactionId` (`common_utils/src/types.rs:1260`) has no serde attribute, so it serializes externally tagged — while the column is `Nullable` (`schema.rs:1073`). The insert renderer's fail-closed arm (catalogued scalar column + non-scalar value, `lifecycle/mod.rs` `sql_literal_for_column`) refuses, `build_insert_sql` returns `None`, and `seed_db` fails the whole entry before any SQL.

**Measured.** Seed certificate: `failed: 153` — every one on `payment_attempt`, every one `could not render an insert` (114 query-fallback + 39 row entries). 70 `payment_attempt` entries with `null` transaction ids materialize fine. Downstream: 51+ correlations fork at `find_one(payment_attempt) → NotFound` → candidate 404s where the recording answered 200.

**Fix fork (decision needed):**
- (a) Revive the producer-metadata path: `row_image_payload_with_metadata` exists and is never used — `deja::db::recorded_output` passes an empty metadata slice, so `db_row_images_from_typed_payload` always falls back. With column metadata the renderer can represent the value correctly. Recording-side change → router build + re-record.
- (b) Serde shape fix on `ConnectorTransactionId` (vendor) — wire-format change; re-record required.
- (c) Renderer-side unwrap of single-key tagged objects into scalars — against the fail-closed design; not recommended.

The fail-closed refusal itself is correct and stays.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.