Add countdown bot reference example#516
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0c1ae463b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if event.pubkey == config.bot_keys.public_key() || event.created_at < started_at { | ||
| return Ok(()); |
There was a problem hiding this comment.
Avoid filtering post-start events by created_at
The startup guard event.created_at < started_at drops valid commands that arrive after subscription when the sender's clock is behind the bot's clock. In Sprout, relay ingest allows a sizeable timestamp drift (±15 minutes), so a newly posted !countdown/!fib from a skewed client can be accepted by the relay but ignored here forever as “old.” This makes the bot silently miss real-time commands; use an EOSE boundary or a since filter instead of comparing untrusted client timestamps to local startup time.
Useful? React with 👍 / 👎.
Summary
Test plan
. ./bin/activate-hermit && cargo fmt -p countdown-bot -- --check. ./bin/activate-hermit && cargo check -p countdown-bot. ./bin/activate-hermit && cargo test -p countdown-botNote: pre-commit/pre-push full hooks were partially blocked locally by missing desktop/web node_modules and missing dart/flutter CLIs; Rust/Tauri checks that could run passed, and this PR is limited to Rust example/docs.