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

fix(timeline): correct updating of reminders and reasons for waiting … #18915

Open
wants to merge 4 commits into
base: 10.0/bugfixes
Choose a base branch
from

Conversation

MyvTsv
Copy link
Contributor

@MyvTsv MyvTsv commented Feb 4, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes !36212
  • This RP corrects several problems with expectations.

If a pending message with restart to a pending task without restart, it did not stop the reminders

If a message waiting with retry to a message waiting without retry, it changes the reason of waiting for the previous message, but does not make a retry

If a message in the queue without retry, to a message in the queue with retry, it changes the reason for waiting of the previous message and starts the reminders on the date of the previous message.

Screenshots (if appropriate):

@MyvTsv MyvTsv requested review from stonebuzz and Rom1-B February 4, 2025 14:35
@MyvTsv MyvTsv self-assigned this Feb 4, 2025
@Rom1-B Rom1-B removed request for stonebuzz and Rom1-B February 5, 2025 08:40
@MyvTsv MyvTsv marked this pull request as ready for review February 5, 2025 08:44
@@ -413,11 +414,29 @@ public static function handlePendingReasonUpdateFromNewTimelineItem(
}
}

if (!isset($new_timeline_item->input['pendingreasons_id']) && $new_timeline_item->getType() === 'TicketTask') {
Copy link
Contributor

Choose a reason for hiding this comment

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

it doesn't matter what type of object is added (Followups / Task), if the pending reason is different it needs to be updated no?

// No actual updates -> nothing to be done
if (count($pending_updates) == 0) {
return;
}

if ($new_timeline_item->getType() === 'ITILFollowup') {
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Comment on lines +646 to +648
// Case 8: ticket with 2 timeline items
// The first set the pending data and the second send the same data
// This simulate what will be sent if a pending task is added after the pending followup
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the existing test cases, when a follow-up (or a task, whatever) is added to a ticket with a waiting reason, the ticket is set to "waiting" with automatic reminders based on the date of that follow-up. If additional follow-ups are added later, as long as the ticket remains in the waiting state, the reference date does not change (it remains the date of the first follow-up that set the ticket to waiting). If a new follow-up changes the waiting reason, only the parameters are updated, but the reference date remains unchanged. The current test does not check this point; we should see if it can be added. In any case, the current behavior seems to be the expected one, so there is no bug, right?

ping @AdrienClairembault

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