Skip to content

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

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

feat: add last_active_at column and POST /v1/users/me/ping endpoint#954
dylanjeffers merged 1 commit 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?user_id=<encoded_id> endpoint that updates the user's last_active_at to now()
  • Handler uses user_id from query param (decoded by resolveMyIdMiddleware) — no wallet-based auth needed for this low-security activity signal
  • Bypasses requireUserIdMiddleware for /users/me/* routes so the g.Use("/users/:userId") prefix middleware doesn't block literal /users/me/ping

Test plan

  • Verify POST /v1/users/me/ping?user_id=<encoded_id> returns {"status":"ok"} with valid signature headers
  • Verify last_active_at is updated in the DB after a successful ping
  • Verify missing user_id returns 400
  • Verify mobile app foreground triggers the ping correctly

🤖 Generated with Claude Code

@dylanjeffers dylanjeffers enabled auto-merge (squash) June 16, 2026 01:34
…et auth

The handler was using getAuthedWallet(c) which required signature-based
auth, then updating by wallet address. This was overcomplicated for a
fire-and-forget activity signal. Now uses myId from the user_id query
param (already decoded by resolveMyIdMiddleware) and updates by user_id.

Removes requireAuthMiddleware from the route since the handler no longer
needs the wallet — the global authMiddleware still validates signatures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dylanjeffers dylanjeffers force-pushed the feat/last-active-at-ping branch from 15630c6 to 3daef34 Compare June 16, 2026 01:36
@dylanjeffers dylanjeffers merged commit a8bf890 into main Jun 16, 2026
3 checks passed
@dylanjeffers dylanjeffers deleted the feat/last-active-at-ping branch June 16, 2026 01:36
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