Skip to content

Fix login handler#128

Merged
gkorland merged 1 commit intostagingfrom
fix-handler
Aug 25, 2025
Merged

Fix login handler#128
gkorland merged 1 commit intostagingfrom
fix-handler

Conversation

@gkorland
Copy link
Copy Markdown
Contributor

@gkorland gkorland commented Aug 25, 2025

Summary by CodeRabbit

  • New Features

    • Destructive SQL confirmation in the query flow with optional post-execution schema refresh.
    • Post-login callback hooks for Google/GitHub OAuth.
    • Global Google Tag Manager ID available to templates.
  • Performance

    • Faster, more responsive graph queries via asynchronous and concurrent processing.
    • Asynchronous loaders for CSV, JSON, OData, MySQL, and Postgres.
  • UX/Style

    • Refreshed left toolbar icons for clearer visuals.
  • Documentation

    • Updated Postgres loader examples to use async.
  • Refactor

    • Broad backend migration to async I/O with improved database initialization and error handling.

@gkorland gkorland requested review from Copilot and galshubeli August 25, 2025 14:16
@vercel
Copy link
Copy Markdown

vercel bot commented Aug 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
queryweaver Ready Ready Preview Comment Aug 25, 2025 2:17pm

@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@gkorland gkorland changed the base branch from main to staging August 25, 2025 14:16
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Broad async migration across agents, auth, loaders, graph access, and routes. Switched FalkorDB and Redis clients to asyncio, updated function signatures and call sites to awaitable forms, added OAuth setup/callback hooks, reworked query flow with concurrency/timing, adjusted templates for GTM and icons, updated docs/tests, and removed an ontology script.

Changes

Cohort / File(s) Summary of changes
Async DB client and graph APIs
api/extensions.py, api/graph.py
Moved to asyncio clients (FalkorDB/Redis), added pooled init with error handling; converted get_db_description and find to async with new concurrent, embedding-driven search helpers and updated return types.
Async auth and user management
api/auth/user_management.py, api/auth/oauth_handlers.py
Converted ensure_user_in_organizations and update_identity_last_login to async; updated OAuth handlers to await these calls.
App factory and OAuth setup
api/app_factory.py, api/routes/auth.py
Initialized OAuth via setup_oauth_handlers; removed GTM middleware and exposed google_tag_manager_id via template globals; added optional, awaited post-login callbacks for Google/GitHub.
Agent async conversion
api/agents/relevancy_agent.py
RelevancyAgent.get_answer changed to async def; internal logic unchanged; callers must await.
Loaders async migration
api/loaders/graph_loader.py, api/loaders/json_loader.py, api/loaders/csv_loader.py, api/loaders/odata_loader.py, api/loaders/mysql_loader.py, api/loaders/postgres_loader.py
Converted loader entry points and core load_to_graph to async; all graph.query operations awaited; refresh paths for MySQL/Postgres now async; minor formatting adjustments.
Routes async and pipeline refactor
api/routes/graphs.py, api/routes/database.py
Routes now await async loaders/graph ops; query_graph reworked with concurrent tasks, streaming, timing logs, destructive-op confirmation, and optional schema refresh; confirmation and refresh endpoints updated to async.
Template icon updates
app/templates/components/left_toolbar.j2
Replaced inline SVGs with Lucide-style stroke icons; no behavioral changes.
Docs update
docs/postgres_loader.md
Examples updated to use await graph.query(...).
Tests update
tests/test_mysql_loader.py, tests/test_postgres_loader.py
Tests invoke async loaders via asyncio.run(...).
File removal
onthology.py
Removed CRM ontology generation script.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant R as /graphs/query (route)
  participant A as RelevancyAgent
  participant G as Graph API
  participant L as SQL/LLM Engine
  participant DB as DB

  U->>R: Stream user query
  R->>G: get_db_description (await)
  par concurrent analysis
    R->>A: get_answer (await)
    R->>G: graph analysis tasks (await)
  end
  alt Off-topic
    R-->>U: off_topic=true (stream)
  else On-topic
    R->>L: SQL analysis/generation
    alt Destructive SQL
      R-->>U: destructive_confirmation (await user)
      U->>R: confirm
    end
    R->>DB: Execute SQL
    R-->>U: execution results (stream)
    opt Schema refresh needed
      R->>G: refresh_graph_schema (await)
      R-->>U: schema_refresh status (stream)
    end
  end
Loading
sequenceDiagram
  autonumber
  participant U as User
  participant O as OAuth Provider
  participant S as /auth/callback
  participant H as Optional Callback Handler

  U->>O: Login
  O-->>S: Redirect with code
  S->>S: Exchange code, store session
  alt Handler configured
    S->>H: await handler(request, token, user_info)
  end
  S-->>U: Redirect to app
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • Staging #95 — Broad async/FastAPI migration touching auth, loaders, routes, and graph modules similar to these changes.
  • Async graph worker #98 — Converts RelevancyAgent and related functions to async, overlapping with this PR’s async transitions.
  • fix GOOGLE_TAG_MANAGER_ID #122 — Adjusts GOOGLE_TAG_MANAGER_ID handling to template globals, matching the GTM changes here.

Suggested reviewers

  • swilly22

Poem

A rabbit taps keys with a whiskery grin,
Async winds hum as the queries begin.
Loaders all hop, await in a row,
Graphs weave replies in a streaming flow.
OAuth carrots? Callbacks secure.
New icons shine—sleek and pure.
Thump! Ship it—fast and sure. 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a9dd3b3 and b8e426d.

📒 Files selected for processing (20)
  • api/agents/relevancy_agent.py (1 hunks)
  • api/app_factory.py (2 hunks)
  • api/auth/oauth_handlers.py (2 hunks)
  • api/auth/user_management.py (4 hunks)
  • api/extensions.py (2 hunks)
  • api/graph.py (4 hunks)
  • api/loaders/csv_loader.py (2 hunks)
  • api/loaders/graph_loader.py (5 hunks)
  • api/loaders/json_loader.py (2 hunks)
  • api/loaders/mysql_loader.py (5 hunks)
  • api/loaders/odata_loader.py (2 hunks)
  • api/loaders/postgres_loader.py (5 hunks)
  • api/routes/auth.py (3 hunks)
  • api/routes/database.py (2 hunks)
  • api/routes/graphs.py (14 hunks)
  • app/templates/components/left_toolbar.j2 (1 hunks)
  • docs/postgres_loader.md (1 hunks)
  • onthology.py (0 hunks)
  • tests/test_mysql_loader.py (3 hunks)
  • tests/test_postgres_loader.py (3 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-handler

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gkorland gkorland merged commit a8fa395 into staging Aug 25, 2025
10 of 13 checks passed
@gkorland gkorland deleted the fix-handler branch August 25, 2025 14:18
@coderabbitai coderabbitai bot mentioned this pull request Oct 2, 2025
gkorland added a commit that referenced this pull request Feb 22, 2026
…react-0.441.0

Bump lucide-react from 0.372.0 to 0.441.0
@gkorland gkorland review requested due to automatic review settings March 23, 2026 22:53
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