Skip to content

Conversation

@jessevz
Copy link
Contributor

@jessevz jessevz commented Sep 19, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds validation to handle cases where TaskWrapper objects may not have associated Task objects, improving robustness of the backend task management system.

Key changes:

  • Added null checks for task objects retrieved from TaskWrapper queries
  • Implemented error handling for invalid TaskWrapper states in priority updates and deletion operations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
TaskwrapperUtils.class.php Added null check and exception throwing for invalid TaskWrapper in priority update method
taskwrappers.routes.php Added conditional logic to handle TaskWrapper deletion when no associated Task exists

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

$joined = Factory::getTaskFactory()->filter([Factory::FILTER => $qF, Factory::JOIN => $jF]);
$task = $joined[Factory::getTaskFactory()->getModelName()][0];
if ($task === null) {
throw new HttpError("Invallid task, Taskwrapper does not have a task");
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

There is a spelling error in the error message. 'Invallid' should be 'Invalid'.

Suggested change
throw new HttpError("Invallid task, Taskwrapper does not have a task");
throw new HttpError("Invalid task, Taskwrapper does not have a task");

Copilot uses AI. Check for mistakes.
@gpascal123 gpascal123 merged commit 18c80c8 into dev Sep 19, 2025
2 checks passed
@gpascal123 gpascal123 deleted the more-task-validation branch September 19, 2025 10:06
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

Successfully merging this pull request may close these issues.

3 participants