Skip to content

feat: add last_active_at column and POST /v1/users/me/ping endpoint#953

Merged
dylanjeffers merged 2 commits into
mainfrom
feat/last-active-at-ping
Jun 16, 2026
Merged

feat: add last_active_at column and POST /v1/users/me/ping endpoint#953
dylanjeffers merged 2 commits into
mainfrom
feat/last-active-at-ping

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Summary

  • Adds last_active_at timestamp column to the users table (migration 0221)
  • Adds POST /v1/users/me/ping endpoint that updates last_active_at for the authenticated user
  • Fixes routing: the g.Use("/users/:userId") prefix middleware was catching /users/me/ping (with :userId="me") and returning 400 before the ping handler could run — the middleware now passes through when :userId is the literal "me"

Test plan

  • Verify POST /v1/users/me/ping returns {"status": "ok"} for authenticated requests
  • Verify last_active_at is updated in the DB after a ping
  • Verify existing /users/:userId routes still resolve user IDs correctly
  • Verify GET /users/<invalid_id> still returns 400

🤖 Generated with Claude Code

dylanjeffers and others added 2 commits June 15, 2026 16:16
Adds a `last_active_at` timestamptz column to the users table and a new
authenticated endpoint that upserts it on each app-open. This replaces
plays-based inactivity detection with a direct activity signal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The g.Use("/users/:userId") prefix middleware was matching POST
/users/me/ping (with :userId="me"), causing a 400 before the ping
handler could run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dylanjeffers dylanjeffers merged commit acd7c5d into main Jun 16, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the feat/last-active-at-ping branch June 16, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant