Skip to content

876 task list error handling#22754

Merged
leonidasmi merged 11 commits intofeature/task-listfrom
876-task-list-error-handling
Nov 27, 2025
Merged

876 task list error handling#22754
leonidasmi merged 11 commits intofeature/task-listfrom
876-task-list-error-handling

Conversation

@vraja-pro
Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro commented Nov 26, 2025

Context

Summary

This PR can be summarized in the following changelog entry:

  • [@yoast/dashboard-frontend 0.1.0] Adds support for error handling for the task modal.
  • [@yoast/dashboard-frontend 0.1.0] Adds the GetTasksErrorRow components to support error handling for the tasks table.
  • [@yoast/dashboard-frontend 0.0.1] Fixes an unreleased bug where the Task loading row will adds extra column.

Relevant technical choices:

  • Removed the fetchJson because it throws an error before parsing the message.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Failure to complete the llms.txt task:

  • When the llms.txt feature is disabled, add the following snippet (this will force failure to turn the llms.txt feature from disabled to enabled - remember to remove it afterwards)
function custom_update_option_wpseo( $value, $old_value, $option ) {
    return $old_value;
}
add_action( 'pre_update_option_wpseo', 'custom_update_option_wpseo', 10, 3 );
  • Go to the tasks list and open the llms.txt task and try to complete it.
  • Confirm that you get the following alert in the modal:
Screenshot 2025-11-26 at 16 07 43
  • Remove the snippet and open the network tab and add offline in the throttling dropdown:
image
  • Try to complete the task again and confirm you get an alert with a generic error this time:
image

Failure to complete the delete Hello World task:

  • Have a site where there is the "Hello world" post that was not edited.
  • Add the following snippet (this will force failure to delete any posts - remember to remove it afterwards)
function custom_pre_delete_post( $check, $post, $force_delete ) {
    return false;
}
add_filter( 'pre_delete_post', 'custom_pre_delete_post', 10, 3 );
  • Go to the tasks list and try to complete the task "Remove the “Hello World” post"
    Check you get a similar alert in the modal, only the content is different:
    Failed to delete the Hello World post. If the issue continues, our support team is here to help!

Failure to get tasks:

  • Add the following snippet (this will force failure to get any tasks - remember to remove it afterwards)
add_filter( 'wpseo_task_list_post_type_tasks', 'custom_task_list_post_type_tasks', 10, 3 );

function custom_task_list_post_type_tasks( $post_type_tasks ) {
    return array_merge( $post_type_tasks, [ 'new-task' => [ 'new-task' ] ] );
}
  • Go to the tasks list
  • Confirm that you get the following error in the table
Screenshot 2025-11-26 at 16 11 52
  • Check the progress bar doesn't have the loading animation.
  • Open the console and check you see an error: Error fetching tasks: Error: Added invalid post type task.
  • When tasks are loading, Check there is no extra column after priority.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have ran grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Task list: Error handling

@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Nov 26, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Nov 26, 2025

Pull Request Test Coverage Report for Build 0cc7bffb94b233f983b403de828cd513806c9072

Details

  • 13 of 44 (29.55%) changed or added relevant lines in 6 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.002%) to 53.39%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/general/components/task.js 0 1 0.0%
packages/dashboard-frontend/src/task-list/components/get-tasks-error-row.js 1 7 14.29%
packages/dashboard-frontend/src/store/task-list.js 1 12 8.33%
packages/js/src/general/routes/task-list.js 0 13 0.0%
Files with Coverage Reduction New Missed Lines %
packages/dashboard-frontend/src/store/task-list.js 2 33.33%
Totals Coverage Status
Change from base Build b2920dcf38d74c4d7fe31d7d092cf4d995f48ab4: -0.002%
Covered Lines: 32406
Relevant Lines: 60950

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR: 🏗️

Comment thread packages/js/src/general/routes/task-list.js Outdated
Comment thread packages/js/src/general/routes/task-list.js Outdated
Comment thread packages/js/src/general/components/task.js
Comment thread packages/dashboard-frontend/src/task-list/components/get-tasks-error-row.js Outdated
vraja-pro and others added 3 commits November 27, 2025 10:52
Co-authored-by: Leonidas Milosis <leonidas.milossis@gmail.com>
Co-authored-by: Leonidas Milosis <leonidas.milossis@gmail.com>
@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@leonidasmi leonidasmi added this to the feature/task-list milestone Nov 27, 2025
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR + Acceptance is ✅

@leonidasmi leonidasmi merged commit bd247f2 into feature/task-list Nov 27, 2025
26 checks passed
@leonidasmi leonidasmi deleted the 876-task-list-error-handling branch November 27, 2025 11:26
@leonidasmi leonidasmi modified the milestones: feature/task-list, 26.6 Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants