mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-04 12:07:11 +01:00
Caught by checking production rather than by reading the code: the queue had deployed, and the Cat still had no account. Following that through, it never would have got one. The circularity: resolveMentions can only flag @cat when a Cat PROFILE exists, so with no account nothing is ever queued — and the worker called ensureCatAccount AFTER its empty-queue early return, so an empty queue established nothing. Nothing queued, so nothing was established, so nothing queued. A freshly deployed platform would sit there with @cat resolving to nobody, looking exactly like a working feature that nobody had used yet. The worker now establishes the account before it looks at the queue. One primary-key lookup per tick when it is a no-op, which is every tick after the first, and the every-minute timer therefore becomes what brings the Cat into existence. Second half of the same bug, in the timer: `Persistent=true` only replays a run MISSED while the machine was down. A timer enabled for the first time just waits for the next OnCalendar — for a daily timer, up to 24 hours. Production confirmed it: the unit was installed and enabled, LAST was "-", NEXT was 12 hours away. OnActiveSec=1min makes a freshly deployed Cat exist within the minute. Pinned by a test that asserts the ORDERING, not just the call, and proven by restoring the old arrangement — two tests go red. Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Scripts Directory
This directory contains all automation scripts organized by purpose.
Directory Structure
analysis/- Bundle analysis, documentation checking, and optimization toolsauth-fix/- Scripts to fix authentication and RLS policy issuesdb/- Database operations, migrations, and schema management- Migration scripts moved from root:
apply-migration.js,apply-*-migration.js - Old schema files archived in
db/archive/
- Migration scripts moved from root:
deployment/- Deployment, production setup, and monitoring scriptsdev/- Development helpers, local setup, and debugging toolsdiagnostics/- Health checks and system diagnosticsmaintenance/- Cleanup, optimization, and maintenance scriptsmonitoring/- Performance monitoring and bundle size trackingoauth/- OAuth provider setup and configurationprofile-fix/- Scripts to fix profile-related issuesschema-fix/- Database schema fixes and migrationsstorage/- Supabase storage bucket setup and managementtest/- Testing utilities and validation scripts- Test/debug scripts moved from root:
test-*.js,check-*.js,debug-*.js
- Test/debug scripts moved from root:
Usage
Most scripts can be run with:
node scripts/{category}/script-name.js
For deployment scripts:
bash scripts/deployment/script-name.sh
Important Scripts
scripts/dev/dev-start.js- Main development server starterscripts/deployment/browser-verify.js- Post-deploy browser smoke test (deploys themselves happen on the box — see docs/deployment/DEPLOYMENT_PROCESS.md)scripts/db/apply-migrations.ts- Database migrationsscripts/maintenance/cleanup-console-logs.ts- Remove console.log statements