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

Campaign events reschedules due to DST #11602

Merged
merged 5 commits into from
Oct 18, 2022
Merged

Conversation

rohitpavaskar
Copy link
Contributor

Q A
Bug fix? (use the a.b branch) [Y]
New feature/enhancement? (use the a.x branch) [N]
Deprecations? [N]
BC breaks? (use the c.x branch) [N]
Automated tests included? [Y]
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#...
Issue(s) addressed Fixes #...

Description:
Campaign events can get stuck in an hourly rescheduling loop with the following circumstances:

The event was evaluated prior to a time change that falls back an hour to be executed at a time after the time change. E.g. date_triggered = 2021-10-24 17:00:00 and trigger_date = 2021-11-08 14:00:00.
The event is scheduled at a relative time period at a specific hour or between two hours.

Steps to test this PR:
Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
Create a campaign with event which can be scheduled after 7th November 2021.
Add a contact in Eastern time zone where DST changes are applicable and add that contact to the segment which used in above campaign.
Change date_triggered date in mautic_campaign_lead_event_log to befoe DST 7th November 2021. and verify event get triggered at correct time

@cla-bot cla-bot bot added the cla-signed The PR contributors have signed the contributors agreement label Oct 17, 2022
@npracht npracht added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test campaigns Anything related to campaigns and campaign builder labels Oct 17, 2022
@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Merging #11602 (bdeb906) into 4.4 (18ec528) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##                4.4   #11602   +/-   ##
=========================================
  Coverage     49.96%   49.96%           
- Complexity    35405    35407    +2     
=========================================
  Files          2144     2144           
  Lines        106296   106295    -1     
=========================================
+ Hits          53109    53114    +5     
+ Misses        53187    53181    -6     
Impacted Files Coverage Δ
...aignBundle/Executioner/Scheduler/Mode/Interval.php 91.36% <100.00%> (+4.22%) ⬆️

@escopecz escopecz merged commit b4ea234 into mautic:4.4 Oct 18, 2022
escopecz added a commit that referenced this pull request Oct 18, 2022
@escopecz escopecz added this to the 4.4.4 milestone Oct 18, 2022
@escopecz
Copy link
Sponsor Member

I merged this by accident. Too many tabs opened. I'll give it a test now.

@escopecz
Copy link
Sponsor Member

@rohitp19 can you please help me with the last step?

Change date_triggered date in mautic_campaign_lead_event_log to befoe DST 7th November 2021. and verify event get triggered at correct time

The date_triggered is already stet to today. Which is before DST change. If I change the trigger_date and then run bin/console m:c:t then it will schedule it back to the date after DST change set in the campaign event. What am I missing?

@rohitp19
Copy link
Contributor

@rohitp19 can you please help me with the last step?

Change date_triggered date in mautic_campaign_lead_event_log to befoe DST 7th November 2021. and verify event get triggered at correct time

The date_triggered is already stet to today. Which is before DST change. If I change the trigger_date and then run bin/console m:c:t then it will schedule it back to the date after DST change set in the campaign event. What am I missing?

This condition can be tested when server current time is outside DST and date_triggered inside DST

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs campaigns Anything related to campaigns and campaign builder cla-signed The PR contributors have signed the contributors agreement ready-to-test PR's that are ready to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants