Skip to content

fix: prevent generator hang and reject negative floor ids - #119

Merged
Joltras merged 2 commits into
devfrom
fix/secret-room-infinite-loop
Nov 2, 2026
Merged

Joltras merged 2 commits into
devfrom
fix/secret-room-infinite-loop

Conversation

@Joltras

@Joltras Joltras commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Proposed changes

The secret room placement could loop forever when no valid position existed, which hung roughly 18% of floor 0 generations and blocked the whole API, since the endpoints run synchronously inside async handlers. The loop now stops once no position with at least one neighbour is found, and all previously working seeds produce identical floors. Negative floor ids now raise a ValueError in the generator and return 422 from the API instead of crashing with a 500. Regression tests cover the hanging seeds and the new validation, and httpx was added to requirements.txt because FastAPI's TestClient needs it.

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

@Joltras
Joltras merged commit d910f43 into dev Nov 2, 2026
4 checks passed
@theEvilReaper
theEvilReaper deleted the fix/secret-room-infinite-loop branch November 3, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant