Demo mode's showcase schemes are approved with no segments, so every showcase night pushes nothing #171

Open
opened 2026-09-26 09:26:33 +00:00 by claude-bot · 0 comments
Collaborator

Bug

In demo mode (#63), the showcase schemes the seeder approves (Halloween and the others) are stored with zero segments. Every one of those nights pushes {"on": true, "bri": 200, "seg": []}, and the calendar, the side panel and the season preview (#151) all show them unlit. #63's whole promise is that "the calendar has colour in it", and it doesn't.

This was confirmed in a running demo container while building #151: halloween_2026_mid is approved with "segments": []. The season preview reports it accurately; the preview is right, the data is wrong.

Cause

demo_seed.seed() approves the showcase schemes in the same call that creates the segments, which is before main.py's startup regeneration pass. The regeneration then skips them, because generate_schemes_for_event deliberately never touches approved rows. So they stay as they were when approved: empty.

Fix

Order the operations so the schemes have segments before they are approved:

  • Either approve after the regeneration pass in main.py's lifespan,
  • or split seed() into two calls: segments and events first, then approve once the schemes have been generated.

Add a test that starts the app with DEMO_MODE=true on an empty database and asserts that every approved showcase scheme has one segment per themed segment, and a non-empty pushed seg list.

Also

CI's docker-e2e job doesn't set DEMO_MODE, so nothing covers demo mode end to end. Consider running at least one E2E spec against a demo-mode container. That would have caught this.

## Bug In demo mode (#63), the showcase schemes the seeder approves (Halloween and the others) are stored with **zero segments**. Every one of those nights pushes `{"on": true, "bri": 200, "seg": []}`, and the calendar, the side panel and the season preview (#151) all show them unlit. #63's whole promise is that "the calendar has colour in it", and it doesn't. This was confirmed in a running demo container while building #151: `halloween_2026_mid` is approved with `"segments": []`. The season preview reports it accurately; the preview is right, the data is wrong. ## Cause `demo_seed.seed()` approves the showcase schemes in the same call that creates the segments, which is *before* `main.py`'s startup regeneration pass. The regeneration then skips them, because `generate_schemes_for_event` deliberately never touches approved rows. So they stay as they were when approved: empty. ## Fix Order the operations so the schemes have segments before they are approved: - **Either** approve after the regeneration pass in `main.py`'s lifespan, - **or** split `seed()` into two calls: segments and events first, then approve once the schemes have been generated. Add a test that starts the app with `DEMO_MODE=true` on an empty database and asserts that every approved showcase scheme has one segment per themed segment, and a non-empty pushed `seg` list. ## Also CI's `docker-e2e` job doesn't set `DEMO_MODE`, so nothing covers demo mode end to end. Consider running at least one E2E spec against a demo-mode container. That would have caught this.
claude-bot added this to the v1.2.0 milestone 2026-09-26 09:26:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Iris-WLED#171
No description provided.