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

Maintain property names for serialized schedules #345

Merged
merged 3 commits into from
Aug 7, 2019
Merged

Conversation

thenbrent
Copy link
Contributor

Prior to #333, recurring schedules used different property names to refer to equivalent data. For example, IntervalSchedule::start_timestamp was the same as SimpleSchedule::timestamp.

PR #333 aligned properties and property names for better inheritance. However, in doing so, it also broke backward compatibility with schedule data serialized and stored prior to AS 3.0.0.

While that was a known issue, what wasn't realised at the time is that sites may downgrade to AS < 3.0.0. In some cases, they may do this completely unintentionally or unaware. For example, because they deactivate a plugin with AS >= 3.0.0 and another plugin is still running AS < 3.0.0.

For most cases, this won't be a major issue. Their data will have been migrated to a custom data store when upgrading to AS 3.0.0, so when downgrading, AS < 3.0.0 won't select and attempt to continue running with any data stored with AS >= 3.0.0.

However, there is the case of a site which has the custom tables plugin installed. Those sites will continue to claim the data in the new format, even though AS will be looking for properties on schedules in the old format.

This creates the infinite loops mentioned in #340.

To guard against the possibility of infinite loops if downgrading to Action Scheduler < 3.0.0, we need to also store the data with the old property names so if it's unserialized in AS < 3.0, the schedule doesn't end up with a 0 recurrence.

This PR handles that.

It also sneaks in a couple of commits to tweak docblocks added in #333.

Fixes #340.

Rather than duplicating the docblock in CronSchedule & IntervalSchedule,
link to it.
@thenbrent thenbrent added this to the 3.0.0 milestone Aug 6, 2019
@rrennick
Copy link
Contributor

rrennick commented Aug 6, 2019

This is failing the unit tests on missing scheduled_timestamp.

Prior to #333, recurring schedules used different property names
to refer to equivalent data.

For example, IntervalSchedule::start_timestamp was the same as
SimpleSchedule::timestamp.

PR #333 aligned properties and property names for better inheritance.

To guard against the possibility of infinite loops if downgrading to
Action Scheduler < 3.0.0, we need to also store the data with the old
property names so if it's unserialized in AS < 3.0, the schedule
doesn't end up with a 0 recurrence.

Fixes #340.
@thenbrent
Copy link
Contributor Author

I've fixed that up @rrennick.

Copy link
Contributor

@rrennick rrennick left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@rrennick rrennick merged commit 6354efe into version_3_0_0 Aug 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the issue_340 branch August 7, 2019 14:02
thenbrent pushed a commit that referenced this pull request Aug 8, 2019
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.

2 participants