Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sync application information with site records #15671

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xuzijie1995
Copy link

Sync Application Information with Site Records for Data Consistency

Fixes #15670

Summary

This update ensures that when application information is modified, the corresponding Site records are also updated to maintain data consistency across the system. This fixes the issue where preview URLs show outdated application names after updates.

Changes Implemented

  • Enhanced app_service.update_app to sync name, description, and icon settings to Site
  • Modified app_service.update_app_name to sync name changes to Site title
  • Updated app_service.update_app_icon to sync icon changes to Site
  • Added synchronization logic to ensure site records are updated when application details change

Technical Details

  • Added event handler for application name updates
  • Implemented synchronization between applications and sites tables
  • Ensured database commits properly update both tables

Testing

  • Verified name updates are reflected in preview URLs
  • Tested synchronization with:
    • Application name changes
    • Icon updates
    • Description modifications

Impact

This ensures that users always see the most up-to-date information when:

  • Viewing applications through the web interface
  • Sharing preview URLs with stakeholders
  • Demonstrating applications to management

Related Issue

This PR addresses the synchronization issue detailed in #15670, where application name updates were not being reflected in the preview URLs.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

- Enhanced app_service.update_app to sync name, description, and icon settings to Site
- Modified app_service.update_app_name to sync name changes to Site title
- Updated app_service.update_app_icon to sync icon changes to Site

This ensures that users always see the most up-to-date information when viewing
applications through the web interface.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 💪 enhancement New feature or request labels Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🔄 Sync Application Data with Site Records: Inconsistent Information Display
1 participant