Skip to content

Use websocket bridge for snapshot and pedalboard change events#141

Open
sastraxi wants to merge 25 commits intoTreeFallSound:pistomp-v3from
sastraxi:feat/websocket-sync
Open

Use websocket bridge for snapshot and pedalboard change events#141
sastraxi wants to merge 25 commits intoTreeFallSound:pistomp-v3from
sastraxi:feat/websocket-sync

Conversation

@sastraxi
Copy link
Copy Markdown
Contributor

@sastraxi sastraxi commented May 10, 2026

Rather than loading last.json and detecting modification time changes, we can load the current pedalboard using the REST API on startup (mod-ui starts before pistomp) and then track pedalboard changes using websocket messages.

We still use the polling loop for mod-ui changes, but instead of checking the file, we check for queued messages from mod-ui on the websocket since the last time we checked.

Bonus: we can actually read snapshot changes this way too, so this PR also adds that feature to sync the current snapshot if changed in MOD-UI.

Branch stack

# Conflicts:
#	modalapi/websocket_bridge.py
At startup self.current can be None before the first pedalboard loads,
causing a crash if the pedalboard monitor fires before initialization
is complete.
# Conflicts:
#	modalapi/modhandler.py
@sastraxi sastraxi changed the title Feat/websocket sync Use websocket bridge for snapshot and pedalboard change events May 10, 2026
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