Spaces:
Running on Zero
Running on Zero
Commit History
28 days ago
-
fix: await the timezone lookup, and copy Postgres data across environments
The timezone fix in 2cdaf35 was broken and the regression test could not catch it. `user_today()` called the async `_tz_for()` without awaiting it, so pytz.timezone() received a coroutine, raised, and the code silently fell back to the machine timezone -- exactly the bug it was supposed to fix. The test passed because it asserted the fallback result. `user_today()` is now async and every caller awaits it, and the test sets two different timezones for the same frozen instant so a fallback can no longer satisfy it. Also add scripts/copy_postgres.py for the actual data migration. The bot's history lived in SQLite, was migrated to a local Postgres, and Supabase only ever received the schema -- so the production bot started from an empty database. The copy is additive (ON CONFLICT DO NOTHING never updates or deletes), offsets primary keys because local ids overlapped Supabase's (1..26 vs 21..22, 1..160 vs 1..14) and ON CONFLICT would otherwise silently drop rows, and never overwrites a use…7d3a67d