Add Promo Manager, Content‑Drops, SSHV improvements and major admin/menu refactor; update tests & docs - #94
Conversation
…klet completion + map sync
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sequence DiagramShows the new global pending-action timeout (15 minutes) and how slash commands (/cancel, /menu, /start, /help) escape or clear pending input states. This PR added the timeout, expiration reply, and slash-escape handling in the text message flow. sequenceDiagram
participant User
participant Bot
participant RuntimeStore
User->>Bot: Send text while waiting for input (user.pendingAction)
Bot->>RuntimeStore: Check user.pendingAction.createdAt and PENDING_ACTION_TIMEOUT_MS
alt pendingAction expired (>15m)
RuntimeStore-->>Bot: expired
Bot->>RuntimeStore: clear user.pendingAction
Bot-->>User: "Your pending step timed out..." + Main Menu / Cancel buttons
else pendingAction not expired and text starts with '/'
Bot->>Bot: parse slash command (cancel/menu/start/help)
alt command == /cancel
Bot->>RuntimeStore: clear user.pendingAction
Bot-->>User: "Pending action cancelled." + Main Menu
else command in (menu,start,help)
Bot->>RuntimeStore: clear user.pendingAction
Bot->>User: sendMainMenu
else
Bot->>Bot: continue handling pendingAction or pass-through
end
end
Generated by CodeAnt AI |
|
CodeAnt AI finished reviewing your PR. |
User description
Motivation
RUNEWAGER_FUNCTIONALITY_MAP.md, updatedCLAUDE.md) and provide safer default env/gitignore handling.Description
index.js: introducedpromoManagerStore(DB filedata/promo-manager-db.json), promo normalization/parsing, promo claim lifecycle (claims, approval, cooldowns), broadcast/announcement builder, content-drops manager (renamed from tips) with scheduler and target resolution, enhanced SSHV console (editor, locking, sandbox hints), persistent user/admin main menus, pending-action timeout (15m), and many helper utilities (serialize/deserialize, validate paths, save/load JSON, safe button dedupe, etc.).promo-message.jswith safe read/write and exportedgetPromoMessage/setPromoMessageAPI..env.examplewith docs forWEBAPP_HMAC_KEYandLOG_LEVEL, updated.gitignoreto allow example env templates and to generically ignoredata/*.jsonand backups.evaluatePromoEligibility), promo rendering/preview, claims queue with optional auto-approve, and user-facing promo menu that only shows eligible promos.RUNEWAGER_FUNCTIONALITY_MAP.md(comprehensive feature map) and updatedCLAUDE.mdwith an AI coder contract section; clarified many behaviors inindex.jsdoc comments.Testing
node:testsuite intest/unit.test.js) covering core pure functions (bonus state machine, serialization helpers, username normalization, markdown escaping); all unit tests passed.test/smoke.test.js) that validate JS syntax, registered command parity, and callback/button coverage; smoke tests passed locally with the updated static analysis of callbacks and regex handlers.test/runtime.test.js) for backup/restore scripts; the backup and restore checks passed.Codex Task
CodeAnt-AI Description
Enforce 15-minute pending-action timeout and add menu/callback integrity checks
What Changed
Impact
✅ Fewer stuck input sessions✅ Clearer timeout recovery to Main Menu✅ Fewer broken menu buttons or missing commands💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.