Skip to content

Fix missing database commit in provider update handler #24356

@laipz8200

Description

@laipz8200

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

Latest development version

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Trigger a message creation event that causes provider quota updates
  2. Observe that the database transaction updates are prepared but not committed
  3. Check the database and notice that provider quota deductions are not persisted

✔️ Expected Behavior

When provider quotas are updated after message creation, the changes should be committed to the database to ensure accurate tracking of usage and remaining quotas.

❌ Actual Behavior

The provider update handler prepares database updates but doesn't commit them to the database. The updates are lost when the session ends, causing incorrect quota tracking and potential overuse of provider limits.

Metadata

Metadata

Assignees

Labels

🐞 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions