DROP ALERT NOTES
Test your relay with a recorded drop stream
Save the data: lines from one live session, replay them through your relay from a local file, and watch the filter, dedupe and formatting work.
A drop alert relay is hard to test live, because the stream only talks when a price falls. The fix is to record one real session and replay it: a small local server drips the saved lines into your relay at realistic speed, and you get to watch the filter, the dedupe store and the message format work on demand, as many times as you need.
Record once, keep forever
The stream is plain text, which makes recording trivial. While your reader is connected, tee every raw line to a file: the control object that opens the session, then each data: line as it arrives. One busy hour gives you more test material than a week of waiting for the right drop.
Keep the file verbatim, timing aside. The point of the recording is that your relay cannot tell it apart from the live stream, so do not pretty-print it, do not reorder it, and do not fix the alerts that look wrong. The odd ones are the useful ones.
Replay it locally
A replay server is twenty lines: read the file, write each line with a small delay, flush. Point your relay at the local address instead of the stream URL and start it. Everything downstream of the connection, the parsing, the threshold rule, the dedupe check, the formatter, the webhook queue, now runs against real events.
import time
def replay(path, out, delay=0.05):
with open(path) as f:
for line in f:
out.write(line)
out.flush()
time.sleep(delay)
This is also where the failure drills live. Truncate a line halfway through a JSON array to rehearse a broken frame. Duplicate a batch to check the dedupe keys from the deduplication guide. Send the same alert twice with a gap to confirm the cooldown still holds.
What to verify
Three checks cover most relay bugs. Frame handling: a bare object is a control message and must be skipped, and every array parses cleanly, matching the frame format in the SSE setup guide, checked 2026-10-01. The rule path: each surviving alert passes your threshold exactly once, with no duplicates after a duplicated batch. The output: the message shows the match, the market, the two prices and the fair price, laid out the way the relay guide formats it.
Run the webhook side against a test channel or a request-catcher URL, never the production channel your readers watch.
When the replay disagrees with live
If the relay works on the recording and fails live, the difference is in the connection, not the events: authentication, the plan's stream entitlement, or reconnect behavior. That narrows the search to the connection half of the setup guide, which is exactly what a good recording buys you.
Record the stream once, replay it forever. The live feed is for production; the file is for proof.