Skip to content

"now()" stored as literal string instead of SQL timestamp #95

Description

@Vachhani-Tapan

🐛 Bug Description

update_last_active() and upsert_staged_file() use "now()" as a plain string value in the update dict. The Supabase Python client serializes this to JSON, so PostgreSQL receives the literal string "now()" instead of executing the SQL now() function.

🔁 Steps to Reproduce

  1. Call update_last_active() for any user.
  2. Query the last_active field in the database.
  3. Observe the field contains the string "now()" instead of a real timestamp.

✅ Expected Behavior

The last_active and updated_at fields should contain a proper UTC timestamp representing the current time.

❌ Actual Behavior

All timestamps are set to the literal string "now()", corrupting user activity tracking. Features like "last active X ago" display incorrect values, and admin dormant-user detection based on last_active will not work.

🌍 Environment

Field Value
OS Any
VS Code version Any
GitPhone extension version Any
Python version Any

📋 Additional Context

Files: backend/supabase_service.py:54, backend/supabase_service.py:92
Fix: Use a raw SQL expression (supabase.rpc()) or the Supabase schema function to properly emit SQL now().


Metadata

Metadata

Labels

ECSoC26Required on all scored PRsECSoC26-L1Easy — 5 pts (auto by Sentinel)backendbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions