Skip to content

Conversation

orhanrauf
Copy link
Contributor

@orhanrauf orhanrauf commented Oct 21, 2025

Summary by cubic

Fixes a Pydantic–SQLAlchemy mismatch in the Auth0 auth flow by using the UserUpdate schema to update last_active_at. Prevents validation errors and safely updates the timestamp during authentication.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="backend/airweave/api/deps.py">

<violation number="1" location="backend/airweave/api/deps.py:56">
UserUpdate ignores last_active_at because the schema lacks that field, so update_user_no_auth never persists the timestamp change.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

user = await crud.user.update_user_no_auth(db, id=user.id, obj_in=user)
from airweave.schemas.user import UserUpdate

user_update = UserUpdate(last_active_at=datetime.utcnow())
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserUpdate ignores last_active_at because the schema lacks that field, so update_user_no_auth never persists the timestamp change.

Prompt for AI agents
Address the following comment on backend/airweave/api/deps.py at line 56:

<comment>UserUpdate ignores last_active_at because the schema lacks that field, so update_user_no_auth never persists the timestamp change.</comment>

<file context>
@@ -51,8 +51,10 @@ async def _authenticate_auth0_user(
-    user = await crud.user.update_user_no_auth(db, id=user.id, obj_in=user)
+    from airweave.schemas.user import UserUpdate
+
+    user_update = UserUpdate(last_active_at=datetime.utcnow())
+    user = await crud.user.update_user_no_auth(db, id=user.id, obj_in=user_update)
 
</file context>
Fix with Cubic

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