coder / coder/balatrobot

fix!(lua.endpoints): sell endpoint hangs indefinitely on Invisible Joker

Open
#195 0 comments 0 reactions 1 assignee Claimed by @S1M0N38 View on GitHub
completed-in-dev
Dominant language
Python
Stars
72
Forks
18
PR merge metrics
No merged PRs in 30d

Description

**Ref:** PR #190

## Description

Selling an Invisible Joker (at 2/2 charges) causes the endpoint to hang indefinitely. The response is never sent and the request times out on the client side.

## Steps to Reproduce

1. Start a run: `start({"deck": "RED", "stake": "WHITE", "seed": "INVIS3"})`
2. Select a blind: `select()`
3. Add Invisible Joker: `add({"key": "j_invisible"})`
4. Set chips high to auto-win: `set({"chips": 1000})`
5. Play a hand: `play({"cards": [0]})`
6. Cash out: `cash_out()`
7. Go to next round: `next_round()`
8. Select the next blind: `select()`
9. Set chips high: `set({"chips": 1000})`
10. Play a hand (round 2 to charge Invisible): `play({"cards": [0]})`
11. Cash out: `cash_out()`
12. Add a joker to the right of Invisible: `add({"key": "j_greedy_joker"})`
13. Sell the Invisible Joker: `sell({"joker": 0})`
14. The request hangs indefinitely (no response)

## Expected Behavior

The endpoint should return either success (joker sold) or a timeout error after a reasonable period. It should not hang forever.

## Actual Behavior

The `sell` request never returns. The server log shows "Selling joker 'Invisible Joker'" but no corresponding OK or ERR response. The connection remains open until the client times out.

## Environment

- **OS:** macOS
- **Lovely version:** 0.8.0
- **SMODS version:** v1.0.0~BETA-1221a
- **BalatroBot commit:** 084044e

## Files

- [60028.log](https://github.com/user-attachments/files/28841878/60028.log)
- [60028.req.jsonl.txt](https://github.com/user-attachments/files/28841877/60028.req.jsonl.txt)
- [60028.res.jsonl.txt](https://github.com/user-attachments/files/28841879/60028.res.jsonl.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.