Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(db): support async MySQL sessions by converting mysql+pymysql to mysql+asyncmy#174

Merged
yhjun1026 merged 3 commits intoderisk-ai:mainderisk-ai/OpenDerisk:mainfrom
niiish32x:fix/nsh_mysql_dbmanager_20260323niiish32x/OpenDerisk:fix/nsh_mysql_dbmanager_20260323Copy head branch name to clipboard
Mar 23, 2026
Merged

fix(db): support async MySQL sessions by converting mysql+pymysql to mysql+asyncmy#174
yhjun1026 merged 3 commits intoderisk-ai:mainderisk-ai/OpenDerisk:mainfrom
niiish32x:fix/nsh_mysql_dbmanager_20260323niiish32x/OpenDerisk:fix/nsh_mysql_dbmanager_20260323Copy head branch name to clipboard

Conversation

@niiish32x
Copy link
Copy Markdown
Contributor

Description

image

fix(db): support async MySQL sessions by converting mysql+pymysql to mysql+asyncmy

When using MySQL (mysql+pymysql://), the async engine was not created because
only mysql+ob:// was converted to asyncmy. This caused '_async_session' to
remain None and led to 'NoneType' object is not callable when using
async database operations (e.g., chat conversations).

Changes:

  • Add conversion for mysql+pymysql:// → mysql+asyncmy://
  • Add conversion for plain mysql:// → mysql+asyncmy://
  • Ensures async sessions work for standard MySQL configurations

Fixes chat failures with MySQL: "TypeError: 'NoneType' object is not callable"

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Snapshots:

Include snapshots for easier review.

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

nishenghao.nsh and others added 3 commits March 21, 2026 16:09
…ns & user groups

Plugin market
- Avoid List full-screen Spin on catalog refresh so Switch/notifications stay clickable
- Use App.useApp for message/notification; silent reload after plugin toggle
- Keep initial load as the only blocking spinner

User groups (权限组)
- Split table blocking load vs silent refresh; only “刷新” spins on background reload
- Use silent loadGroups after create/delete/member changes to avoid masking the panel

Auth / user management
- Allow POST /config/feature-plugins when user.role=admin in DB, not only oauth2.admin_users
- Fix getUserId() to read user_no (OAuth) so user-id header matches DB user for admin checks
…mysql+asyncmy

When using MySQL (mysql+pymysql://), the async engine was not created because
only mysql+ob:// was converted to asyncmy. This caused '_async_session' to
remain None and led to 'NoneType' object is not callable when using
async database operations (e.g., chat conversations).

Changes:
- Add conversion for mysql+pymysql:// → mysql+asyncmy://
- Add conversion for plain mysql:// → mysql+asyncmy://
- Ensures async sessions work for standard MySQL configurations

Fixes chat failures with MySQL: "TypeError: 'NoneType' object is not callable"
@github-actions github-actions Bot added the fix label Mar 23, 2026
Copy link
Copy Markdown
Collaborator

@yhjun1026 yhjun1026 left a comment

Choose a reason for hiding this comment

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

r+

@yhjun1026 yhjun1026 merged commit 591e0aa into derisk-ai:main Mar 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.