The app name, icon, icon background, and description on the published app site can not be modified #4078

Closed
opened 2026-02-21 18:04:39 -05:00 by yindo · 7 comments
Owner

Originally created by @kurokobo on GitHub (Jun 13, 2024).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.10

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I think there are two bugs (step 3 for the site initialization and step 6 for the app modification):

  1. Create new app with any name (e,g,NEW APP) and description, with customized icon and its background
    image
  2. Publish the app (Publish -> Publish ) and invoke Run App
    image
  3. 🕷️BUG: The app is launched with default icon and its background, without description
    image
  4. Back to studio and modify app name, icon, icon background, and description
    image
  5. Update the app (Publish -> Update) and invoke Run App again
  6. 🕷️BUG: The app still shows old name, default icon and its background, with empty description
    image

✔️ Expected Behavior

  1. The published app shows customized icon, its background, and description
  2. The app name, icon, background, and description on the published app site can be modified

Actual Behavior

  • As described in Steps to reproduce, the app name, icon, icon background, and description on the published app site are not updated
Originally created by @kurokobo on GitHub (Jun 13, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.10 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I think there are two bugs (step 3 for the site initialization and step 6 for the app modification): 1. Create new app with any name (e,g,`NEW APP`) and description, with customized icon and its background ![image](https://github.com/langgenius/dify/assets/2920259/6d7991fa-98d8-4947-b27f-8bd8887c5887) 2. Publish the app (`Publish` -> `Publish` ) and invoke `Run App` ![image](https://github.com/langgenius/dify/assets/2920259/6ed45d66-9227-4a63-8a40-0d3d13597578) 3. **🕷️BUG**: The app is launched with default icon and its background, without description ![image](https://github.com/langgenius/dify/assets/2920259/14222c3a-9064-4a40-b08a-eaea188e002f) 4. Back to studio and modify app name, icon, icon background, and description ![image](https://github.com/langgenius/dify/assets/2920259/08bedb60-e9ca-409f-a0f1-132f22b64ec8) 5. Update the app (`Publish` -> `Update`) and invoke `Run App` again 6. **🕷️BUG**: The app still shows old name, default icon and its background, with empty description ![image](https://github.com/langgenius/dify/assets/2920259/b6df3591-c1ec-48e3-bca5-c49c06747799) ### ✔️ Expected Behavior 1. The published app shows customized icon, its background, and description 2. The app name, icon, background, and description on the published app site can be modified ### ❌ Actual Behavior - As described in `Steps to reproduce`, the app name, icon, icon background, and description on the published app site are not updated
yindo added the 🐞 bug label 2026-02-21 18:04:39 -05:00
yindo closed this issue 2026-02-21 18:04:39 -05:00
Author
Owner

@kurokobo commented on GitHub (Jun 13, 2024):

I've not tested on the upstream main branch, but I believe these still remain on it.

I think the cause are in following codes, so I will try to fix this and send PR in next few days, thanks! 😃

@kurokobo commented on GitHub (Jun 13, 2024): I've not tested on the upstream `main` branch, but I believe these still remain on it. I think the cause are in following codes, so I will try to fix this and send PR in next few days, thanks! 😃 - https://github.com/langgenius/dify/blob/0.6.10/api/events/event_handlers/create_site_record_when_app_created.py - The site is initialized without icon, background, and description - https://github.com/langgenius/dify/blob/0.6.10/api/services/app_service.py#L315 - The `update_app` does not update any data for the related site - Maybe `update_app_name`, `update_app_icon` should also be fixed
Author
Owner

@dosubot[bot] commented on GitHub (Jun 13, 2024):

Hello, @kurokobo! I'm here to help you with any bugs or questions you have while you wait for a human maintainer. Let's tackle this together!

The issue you're experiencing is likely due to the create_site_record_when_app_created.py file not initializing the site with the icon, background, and description, and the update_app function in app_service.py not updating these attributes for the related site.

Fix for create_site_record_when_app_created.py:

Modify the Site initialization to include the icon, background, and description:

@app_was_created.connect
def handle(sender, **kwargs):
    """Create site record when an app is created."""
    app = sender
    account = kwargs.get('account')
    site = Site(
        app_id=app.id,
        title=app.name,
        default_language=account.interface_language,
        customize_token_strategy='not_allow',
        code=Site.generate_code(16),
        icon=app.icon,  # Add this line
        icon_background=app.icon_background,  # Add this line
        description=app.description  # Add this line
    )

    db.session.add(site)
    db.session.commit()

Fix for update_app in app_service.py:

Ensure that the update_app function also updates the site attributes:

def update_app(self, app: App, args: dict) -> App:
    """
    Update app
    :param app: App instance
    :param args: request args
    :return: App instance
    """
    app.name = args.get('name')
    app.description = args.get('description', '')
    app.icon = args.get('icon')
    app.icon_background = args.get('icon_background')
    app.updated_at = datetime.now(timezone.utc).replace(tzinfo=None)
    
    # Update related site attributes
    site = app.site
    if site:
        site.title = app.name
        site.description = app.description
        site.icon = app.icon
        site.icon_background = app.icon_background
        site.updated_at = datetime.now(timezone.utc).replace(tzinfo=None)
    
    db.session.commit()

    return app

These changes should ensure that the site is initialized and updated with the custom icon, background, and description when the app is created or updated [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 13, 2024): <!-- Greeting --> Hello, @kurokobo! I'm here to help you with any bugs or questions you have while you wait for a human maintainer. Let's tackle this together! <!-- Answer --> The issue you're experiencing is likely due to the `create_site_record_when_app_created.py` file not initializing the site with the icon, background, and description, and the `update_app` function in `app_service.py` not updating these attributes for the related site. ### Fix for `create_site_record_when_app_created.py`: Modify the `Site` initialization to include the icon, background, and description: ```python @app_was_created.connect def handle(sender, **kwargs): """Create site record when an app is created.""" app = sender account = kwargs.get('account') site = Site( app_id=app.id, title=app.name, default_language=account.interface_language, customize_token_strategy='not_allow', code=Site.generate_code(16), icon=app.icon, # Add this line icon_background=app.icon_background, # Add this line description=app.description # Add this line ) db.session.add(site) db.session.commit() ``` ### Fix for `update_app` in `app_service.py`: Ensure that the `update_app` function also updates the site attributes: ```python def update_app(self, app: App, args: dict) -> App: """ Update app :param app: App instance :param args: request args :return: App instance """ app.name = args.get('name') app.description = args.get('description', '') app.icon = args.get('icon') app.icon_background = args.get('icon_background') app.updated_at = datetime.now(timezone.utc).replace(tzinfo=None) # Update related site attributes site = app.site if site: site.title = app.name site.description = app.description site.icon = app.icon site.icon_background = app.icon_background site.updated_at = datetime.now(timezone.utc).replace(tzinfo=None) db.session.commit() return app ``` These changes should ensure that the site is initialized and updated with the custom icon, background, and description when the app is created or updated <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/events/event_handlers/create_site_record_when_app_created.py)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/services/app_service.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jun 13, 2024):

For shared applications, please go to overview -> settings to set the icon and background. They are different from the way you are talking about, the way you mentioned is meant for the bot in dify itself.

image
@crazywoola commented on GitHub (Jun 13, 2024): For shared applications, please go to overview -> settings to set the icon and background. They are different from the way you are talking about, the way you mentioned is meant for the bot in dify itself. <img width="1218" alt="image" src="https://github.com/langgenius/dify/assets/100913391/7286a0d3-cac6-42aa-bee7-52b595070cde">
Author
Owner

@kurokobo commented on GitHub (Jun 14, 2024):

@crazywoola
Hi, thanks for letting me know that there is a dedicated WebApp Settings screen, I didn't realize that and it is helpful for me 😃

However, this WebApp Settings screen updates not only web app name and its icon but also the bot name (by #857).

If the bot and the web app can have different names and icons for each other by design, and therefore separate configuration screens by design, then even though changing the bot name does not change the web app name, it seems inconsistent that changing the web app name would also change the bot name. Should we revert #857?

Also I still think the web app icon and its background should be initialized to have the same settings with the bot.

@kurokobo commented on GitHub (Jun 14, 2024): @crazywoola Hi, thanks for letting me know that there is a dedicated WebApp Settings screen, I didn't realize that and it is helpful for me 😃 However, this WebApp Settings screen updates not only web app name and its icon but also the bot name (by #857). If the bot and the web app can have different names and icons for each other by design, and therefore separate configuration screens by design, then even though changing the bot name does not change the web app name, it seems inconsistent that changing the web app name would also change the bot name. Should we revert #857? Also I still think the web app icon and its background should be initialized to have the same settings with the bot.
Author
Owner

@crazywoola commented on GitHub (Jun 14, 2024):

I've kind of forgotten why I did it before.

@crazywoola commented on GitHub (Jun 14, 2024): I've kind of forgotten why I did it before.
Author
Owner

@kurokobo commented on GitHub (Jun 14, 2024):

@crazywoola
Thanks, I've just opend related PRs for this topic: #5225, #5227

@kurokobo commented on GitHub (Jun 14, 2024): @crazywoola Thanks, I've just opend related PRs for this topic: #5225, #5227
Author
Owner

@crazywoola commented on GitHub (Jun 14, 2024):

Yes this makes sense, and it did make the behavior much more consistent.

@crazywoola commented on GitHub (Jun 14, 2024): Yes this makes sense, and it did make the behavior much more consistent.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4078