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

Fixes #24627: We can add the same score details column many times in nodes tables #5645

Conversation

VinceMacBuche
Copy link
Member

@VinceMacBuche VinceMacBuche requested a review from fanf May 2, 2024 16:36
success: function (data) {
scoreList = data.data
},
}).done( function() {refresh(gridId)} )
Copy link
Contributor

Choose a reason for hiding this comment

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

This does a 2nd API request for node details every time we create the table, is there a way without the refresh ?

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_24627/we_can_add_the_same_score_details_column_many_times_in_nodes_tables branch from 669f68b to 28956d9 Compare May 3, 2024 10:27

$.ajax({
type: 'GET',
url: "/rudder/secure/api/scores/list",
success: function (data) {
scoreList = data.data
},
})

Copy link
Contributor

Choose a reason for hiding this comment

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

We still have a race condition with this block, that executes asynchronously ($.ajax is fire-and-forget).
When it finished BEFORE the execution of the code that looks into localStorage for score columns, it works normally. But it often finishes AFTER, and the list is [], so we are still displaying system-updates Score instead of System updates Score (because there is a "guard" to just display the id when we don't know the name of the score...)

@VinceMacBuche VinceMacBuche force-pushed the bug_24627/we_can_add_the_same_score_details_column_many_times_in_nodes_tables branch from 28956d9 to 5a81422 Compare May 23, 2024 17:18
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche
Copy link
Member Author

PR rebased

@VinceMacBuche VinceMacBuche force-pushed the bug_24627/we_can_add_the_same_score_details_column_many_times_in_nodes_tables branch from 5a81422 to 35f8915 Compare May 23, 2024 17:18
@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_24627/we_can_add_the_same_score_details_column_many_times_in_nodes_tables branch from 35f8915 to 483798a Compare May 23, 2024 17:25
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 7925b78 into Normation:branches/rudder/8.1 May 23, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants