mirror of
https://github.com/tiennm99/store-scraper-bot.git
synced 2026-10-11 03:13:50 +00:00
Adds optional group.settings.numDaysWarningNotUpdated, resolved per-group in scheduler and /checkapp with fallback to env default. New commands /settings (read) and /setdayswarning <n|0|default> (write).
2.1 KiB
2.1 KiB
phase, title, status, priority, effort, dependencies
| phase | title | status | priority | effort | dependencies | |
|---|---|---|---|---|---|---|
| 3 | Smoke test | completed | P3 | 15m |
|
Phase 3: Smoke test
Overview
No unit-test suite exists. Validate via syntax checks, the existing secret-leak lint, and a manual Telegram run-through against the deployed bot.
Implementation Steps
node --checkon every modified/new file:src/util/group-settings.jssrc/repository/group-repository.jssrc/scheduler/scheduler.jssrc/bot/commands/check-app.jssrc/bot/commands/get-settings.jssrc/bot/commands/set-days-warning.jssrc/bot/bot.js
npm run lint(secret-leak scan, must pass).- Deploy preview to Vercel (or merge to
mainif direct-deploy is normal). - Manual Telegram smoke (in an authorized test group):
/settings→ table showsnumDaysWarningNotUpdated = (unset) / default 30(or whatever env value is)/setdayswarning 5→ "Days-to-warning set to 5"/settings→ shows5 / 30/checkapp→ header reads>5 days, results reflect 5-day threshold/setdayswarning 0→ "Reset to default (30d)"/settings→ back to unset / 30/setdayswarning abc→ "Invalid arguments"/setdayswarning 9999→ "Invalid arguments"- From an unauthorized chat:
/settings→ "Group is not allowed to use bot"
- Wait for next daily cron OR force-trigger via Vercel cron-now panel; confirm authoritized group with override sees correct threshold in report header.
Success Criteria
- All
node --checkpass npm run lintpasses- Manual Telegram run-through hits every bullet above
- Daily cron report header reflects per-group override (or shows env default for groups with no override)
Risk Assessment
- No automated regression: future refactors could silently break the resolver. Acceptable for now — repo has no tests at all. Document the resolver invariants in the file's leading comment.
- Cron timing: waiting up to 24h for natural cron firing slows verification. Mitigation: hit
/api/crondirectly withAuthorization: Bearer $CRON_SECRETto force a run.