AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Linked Email Identity `Last_sign_in_at` Stays Stale After Password Sign-In

Password sign-in updates user-level `last_sign_in_at` but leaves the linked email identity's timestamp unchanged, causing internally inconsistent auth payloads and breaking session-provider inference.

highConfidence 85%GoTruepgvectorsupabase-js

Origin Analysis

The GoTrue password authentication flow updates only the user record's `last_sign_in_at` and does not propagate the update to the corresponding `email` identity, likely because identity timestamps are only refreshed for the explicitly authenticated provider (e.g., OAuth) and not for the password method.
1. Create a user with linked `email` and `facebook` identities. 2. Sign in with email/password using `POST /auth/v1/token?grant_type=password`. 3. Inspect the returned `user` payload. 4. Compare `user.last_sign_in_at` with the `email` identity's `last_sign_in_at`; observe the mismatch.

Fixing Code Block

Edge Case Audit

This patch assumes that every user with email/password authentication has an `email` identity record; if such an identity is missing (e.g., legacy accounts or data migration issues), the loop will simply skip it, but the user-level update still succeeds, potentially leaving the inconsistency unfixed. Concurrent sign-ins could race on the identity record, though the last write usually wins and timestamps are monotonic. If the database schema changes or the identity model is refactored, this patch must be revisited. Rollback: revert to the original user-only update and clear any cached user payloads to avoid clients seeing the corrected timestamps while the server still behaves incorrectly.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state