Skip to content

Degrade gracefully when data-of-loathing is unavailable#322

Merged
gausie merged 4 commits into
mainfrom
degrade-gracefully-data-of-loathing
Jun 24, 2026
Merged

Degrade gracefully when data-of-loathing is unavailable#322
gausie merged 4 commits into
mainfrom
degrade-gracefully-data-of-loathing

Conversation

@gausie

@gausie gausie commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bumps data-of-loathing to 4.3.1, which falls back to a cached local SQLite database when the remote server is unreachable (previously would throw immediately on any network error)
  • Wraps DataOfLoathingClient.load() in a try/catch so a total load failure (first boot, no cache, server down) no longer crashes the bot — it starts in degraded mode with empty maps, which existing callers already handle gracefully via null checks
  • lastDownloadTime is now updated unconditionally so a failed reload doesn't trigger a retry on every subsequent request
  • Sends a Discord alert via discordClient.alert() if the bot starts in degraded mode

Tests

  • DataOfLoathingClient: load doesn't throw on failure, loaded flag reflects success/failure, reload() doesn't retry within an hour after a failure
  • PizzaTree: returns empty results when built with no data (degraded mode), correctly indexes hookah-eligible effects and excludes avatar effects, precalculate sets the right pizza metadata

@gausie
gausie merged commit e805910 into main Jun 24, 2026
1 check passed
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