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

In chart management, editing any chart properties may result in incorrect updates to the owner badge list #31592

Open
3 tasks
qingshan007 opened this issue Dec 21, 2024 · 9 comments

Comments

@qingshan007
Copy link

Bug description

In chart management, editing any chart properties may result in incorrect updates to the owner badge list,It seems that the latest version 4.0 also has issues。

Screenshots/recordings

de430b9ff19d4ddecc1fa6d4f6611cc 2e9eab87c2887e2f221e1ee2869efec

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

superset version: 3.1.3

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented Dec 21, 2024

Hey @qingshan007, I'm here to help you out with any bugs, questions, or contributions you have in mind. Let's tackle this together!

The issue you're experiencing with incorrect updates to the owner badge list when editing chart properties might be related to how Superset handles updates to owner tags. The after_update method in the ChartUpdater class is responsible for managing these updates. It ensures that the owner tags are correctly added or removed based on the current state of the chart's ownership [1].

If the owner badge list is not updating correctly, it could be due to a problem in this method or related database operations. You might want to check if there are any discrepancies in the TaggedObject table or if the after_update method is being triggered correctly during chart property edits.

Additionally, ensure that your Superset instance is correctly configured and that there are no issues with the database connection or session management that could affect these updates. If the problem persists, reviewing recent changes in the codebase related to chart property editing or owner badge updates might provide further insights.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@qingshan007
Copy link
Author

I found that after refreshing the chart management list, the owner of the chart that was just updated will revert to normal. It seems that this only happens in the chart management section. When I select any chart and edit the owner list of the chart properties, add any user as an owner, and save it, the popup closes and the owner list shows a consistent number of badge circles. However, the list, including the title, is all "undefined undefined", and the badge color is red. @dosu

Copy link

dosubot bot commented Dec 23, 2024

The issue you're encountering, where the owner list displays "undefined undefined" after editing chart properties, is likely related to how the frontend handles the rendering of owner badges. This can occur if the extractOwnerNames function, which constructs the owner's name, does not properly handle cases where first_name and last_name are undefined. This results in the display of "undefined undefined" [1].

To address this, ensure that the extractOwnerNames function includes checks to verify that first_name and last_name are defined before concatenating them. Additionally, the frontend code should handle cases where these values are undefined or null, providing a fallback or default value to prevent such display issues.

The fact that the owner reverts to normal after refreshing suggests that the data is correctly stored in the backend, but the initial rendering might be flawed due to these undefined values. Checking the frontend logic for handling owner data and ensuring proper state management and data fetching can help resolve this issue.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@qingshan007
Copy link
Author

But in Kanban management, editing the Kanban owner is normal, does it just mean that the timing of saving and rendering the chart is not right, @dosu

Copy link

dosubot bot commented Dec 23, 2024

Could you provide more details about the differences in how the Kanban and chart management sections handle saving and rendering? Specifically, any differences in the code or processes that might affect the timing of these operations would be helpful. Additionally, are there any specific logs or error messages that appear when the issue occurs in the chart management section?

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@qingshan007
Copy link
Author

There are no errors in the front-end and back-end, only the owner badge has not been updated. After refreshing the page, it was updated @dosu

Copy link

dosubot bot commented Dec 23, 2024

The issue you're experiencing, where the owner badge does not update until the page is refreshed, suggests a problem with the frontend state management or rendering logic. The FacePile component is responsible for rendering the owner badge list in the chart management section [1]. If the owner badge list is not updating immediately after changes, it could be due to the component not re-rendering with the updated state.

To address this, you might want to check the following:

  1. State Management: Ensure that the state containing the owner information is correctly updated after editing chart properties. This might involve verifying that the state update triggers a re-render of the FacePile component.

  2. Data Fetching: Confirm that the data fetching logic retrieves the latest owner information after an update. This could involve checking if the API call to fetch the updated chart data is made and if the response is correctly processed.

  3. Component Lifecycle: Review the lifecycle methods or hooks used in the component to ensure that it responds to state changes appropriately. This might involve using hooks like useEffect to trigger data fetching or state updates when relevant dependencies change.

By ensuring that the frontend correctly handles state updates and re-renders components when necessary, you should be able to resolve the issue with the owner badge not updating immediately.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@qingshan007
Copy link
Author

emm, However, it's not possible. Let me take a look at the front-end, refreshData(); At present, there are direct violence points. After saving, refresh the entire list @dosu

Copy link

dosubot bot commented Dec 23, 2024

@qingshan007,我是个专注于解决软件bug、回答技术问题和提供工程知识的机器人。关于你提到的前端刷新问题,我可能无法直接提供帮助。不过,如果你认为我应该能够回答这个问题,请随时联系Dosu Team。他们会很乐意听取你的建议!

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

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

No branches or pull requests

1 participant