You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# webapp-sign-error-display: Show Stellar send errors in webapp signing flow
2
+
3
+
## Context
4
+
5
+
Web signing currently shows success immediately after the signed XDR is queued.
6
+
The actual Stellar submission happens later in `bot/infrastructure/workers/signing_worker.py`,
7
+
so Horizon failures like insufficient funds are not surfaced in the WebApp UI.
8
+
The goal of this task is to make the web signing flow wait for the final submission
9
+
result and display the same concrete send error class that the regular wallet flow
10
+
already exposes.
11
+
12
+
## Files/Directories To Change
13
+
14
+
-`webapp/app.py`
15
+
-`webapp/templates/sign.html`
16
+
-`bot/infrastructure/workers/signing_worker.py`
17
+
-`bot/routers/sign.py`
18
+
-`shared/src/shared/constants.py`
19
+
-`shared/src/shared/schemas.py` (only if a shared status payload is needed)
20
+
-`bot/tests/test_signing_flow.py`
21
+
22
+
## Edit Permission
23
+
24
+
-[x] Allowed paths confirmed by user.
25
+
-[x] No edits outside listed paths.
26
+
27
+
Permission evidence (copy user wording or exact confirmation):
28
+
29
+
> ++
30
+
31
+
## Change Plan
32
+
33
+
1.[x] Add a failing regression test in `bot/tests/test_signing_flow.py` for a WebApp-signed transaction that later fails during Stellar submission and must persist an error/result for the UI.
34
+
2.[x] Extend shared Redis status/error fields in `shared/src/shared/constants.py` and, only if needed, `shared/src/shared/schemas.py` to represent final send outcomes without guessing field names ad hoc.
35
+
3.[x] Update `bot/infrastructure/workers/signing_worker.py` and `bot/routers/sign.py` so the worker writes final success or detailed send failure back to Redis instead of deleting the transaction immediately.
36
+
4.[x] Update `webapp/app.py` and `webapp/templates/sign.html` so `/api/tx/{tx_id}` returns final status/error and the WebApp waits for completion before showing success or a concrete send error.
37
+
5.[x] Run focused tests for the signing flow, then broader lint/tests if the focused checks pass.
38
+
39
+
## Risks / Open Questions
40
+
41
+
- The current async queue design intentionally decouples signing from sending; waiting in the WebApp must not break existing bot-side callbacks or cleanup.
42
+
- Redis transaction cleanup timing changes in this task; stale keys must not accumulate on failures.
43
+
- Human-readable Horizon errors already exist in bot flow, but `submit_signed_xdr` currently sends generic chat text in some paths; the WebApp path should reuse decoded error details without widening the change unnecessarily.
44
+
45
+
## Verification
46
+
47
+
-`uv run pytest bot/tests/test_signing_flow.py -q` -> `25 passed`
48
+
-`just lint` -> `ruff check` and `mypy core` passed
49
+
- Confirmed by regression test: failed WebApp send now persists `status=error` and `error=<decoded message>` in Redis for UI polling.
# webapp-chat-send-error: Restore webapp close behavior and show send errors in bot chat
2
+
3
+
## Context
4
+
5
+
Previous implementation incorrectly changed the WebApp UI flow to wait for
6
+
network submission results. The intended behavior is unchanged WebApp UX:
7
+
sign and close immediately. The actual fix should be in the bot flow after
8
+
WebApp signing, so the user sees the same detailed send error in chat that a
9
+
regular wallet send already shows.
10
+
11
+
## Files/Directories To Change
12
+
13
+
-`bot/routers/sign.py`
14
+
-`bot/infrastructure/workers/signing_worker.py`
15
+
-`webapp/app.py`
16
+
-`webapp/templates/sign.html`
17
+
-`webapp/static/js/i18n.js`
18
+
-`shared/src/shared/constants.py`
19
+
-`bot/tests/test_signing_flow.py`
20
+
21
+
## Edit Permission
22
+
23
+
-[x] Allowed paths confirmed by user.
24
+
-[x] No edits outside listed paths.
25
+
26
+
Permission evidence (copy user wording or exact confirmation):
27
+
28
+
> ++
29
+
30
+
## Change Plan
31
+
32
+
1.[x] Replace the WebApp-oriented regression in `bot/tests/test_signing_flow.py` with a bot chat regression that requires detailed Horizon send errors to be included in the Telegram message after WebApp signing.
33
+
2.[x] Update `bot/routers/sign.py` so `submit_signed_xdr()` sends the same detailed send error text to chat for Horizon failures instead of only the generic localized header.
34
+
3.[x] Revert the unintended WebApp waiting/polling changes in `webapp/app.py`, `webapp/templates/sign.html`, `webapp/static/js/i18n.js`, and any no-longer-needed shared/worker status plumbing.
35
+
4.[x] Keep `bot/infrastructure/workers/signing_worker.py` aligned with the original WebApp contract: queue, process, notify in chat, then clean up.
36
+
5.[x] Run focused tests and lint for the touched backend paths.
37
+
38
+
## Risks / Open Questions
39
+
40
+
- The bot has multiple send flows with slightly different error formatting; this fix should improve the WebApp-post-sign path without broad refactoring.
41
+
- Reverting the WebApp polling changes must not break the existing successful close-on-sign behavior.
42
+
43
+
## Verification
44
+
45
+
-`uv run pytest bot/tests/test_signing_flow.py -q` -> `25 passed`
46
+
-`just lint` -> `ruff check` and `mypy core` passed
47
+
- Confirmed by regression test that chat-side send error now contains both the localized `send_error` header and the decoded Horizon reason.
0 commit comments