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

Rollback to more than one version backward leads to upgrade to latest version #3077

Closed
4 tasks
engahmeds3ed opened this issue Sep 9, 2020 · 7 comments · Fixed by #5242
Closed
4 tasks

Rollback to more than one version backward leads to upgrade to latest version #3077

engahmeds3ed opened this issue Sep 9, 2020 · 7 comments · Fixed by #5242
Assignees
Labels
effort: [S] 1-2 days of estimated development time module: tools priority: low Issues that can wait severity: major Feature is not working as expected and no work around available type: bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@engahmeds3ed
Copy link
Contributor

engahmeds3ed commented Sep 9, 2020

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version Yes
  • Used the search feature to ensure that the bug hasn’t been reported before Yes

Describe the bug
When trying to rollback for more than one time this leads to upgrade instead of multiple rollbacks.

To Reproduce
Steps to reproduce the behavior:

  1. I have 3.7.0.1 installled.
  2. I rollback to 3.6.4 and this happened successfully
  3. from that I try to rollback to 3.5.5.1.
  4. Instead it updates to 3.7.0.1

Expected behavior
we have two scenarios here:-

  1. not to rollback more than one time and here we need to adjust the rollback button text to express that it will update or show error message for example.
  2. Open the number of rollbacks and adjust the functionality of the button when user rollback more than one time.

Screenshots
First rollback from 3.7.0.1 to 3.6.4
image

image

Second rollback from 3.6.4 to 3.5.5.1
image

image

Additional context
We need product input here

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@arunbasillal arunbasillal added priority: low Issues that can wait type: bug Indicates an unexpected problem or unintended behavior labels Sep 9, 2020
@arunbasillal
Copy link
Contributor

Open the number of rollbacks and adjust the functionality of the button when user rollback more than one time.

I always thought that the rollback would keep on rolling back. So this is what I think should happen.

  • Let's say a user rolls back to 3.6.4. This WP Rocket should look and behave exactly like when the user installed 3.6.4 the first time.
  • The last stable is hardcoded within WP Rocket. A user on 3.6.4 would expect to rollback to the stable one before that and so on.
  • If the user wants to get the latest version, then they can always update.
  • But if the user (for whatever reason) wants to go back, doing multiple rollbacks is the only way.

Inviting @GeekPress here.

@GeekPress
Copy link
Contributor

This isn't the expected behavior. If we want to rollback twice for any reasons, we should be able to do it.

@engahmeds3ed engahmeds3ed added GROOMING IN PROGRESS Use this label when the issue is currently being groomed. and removed needs: grooming labels Sep 10, 2020
@engahmeds3ed
Copy link
Contributor Author

Reproduce the problem
Yes reproduced locally and on one of our customer sites.
When rollback to 3.6.4 I can see on the rollback button at WPR admin (tools) that we can rollback to 3.5.5.1 and when clicking on it, it updates to 3.7.0.1

Identify the root cause

if ( version_compare( $this->plugin_version, $remote_data->new_version, '<' ) ) {
$transient_value->response[ $remote_data->plugin ] = $remote_data;
}

this line is checking Wordpress plugin latest version and if the latest version is newer than the current version it will add the newer always
I got a question on my mind: why it's rolling back from 3.7.0.1 to 3.6.4 and the answer simply: current version on plugin code is 3.7.0.1 and latest version is 3.7.0.1 so it won't go into this condition.

Scope a solution

if ( version_compare( $this->plugin_version, $remote_data->new_version, '<' ) ) {
$transient_value->response[ $remote_data->plugin ] = $remote_data;
}

this code is called when updating and when rollback so inside rollback function

function rocket_rollback() {

we will define a new constant and check on the first code to stop checking on the last version number.

also add a check on the last version to stop on is: 2.3.7

Estimate the effort
[S]: to check also this code with the team as I can see duplication here:

@arunbasillal Please confirm that the last version to stop on is: 2.3.7 as we started using WP_ROCKET_LASTVERSION constant.

@engahmeds3ed engahmeds3ed added effort: [S] 1-2 days of estimated development time and removed GROOMING IN PROGRESS Use this label when the issue is currently being groomed. labels Sep 10, 2020
@arunbasillal
Copy link
Contributor

@engahmeds3ed

@arunbasillal Please confirm that the last version to stop on is: 2.3.7 as we started using WP_ROCKET_LASTVERSION constant.

I went back quite a lot and this commit confirms that 2.3.7 is indeed the last version - f5e1b8c

Thank you 👍

@piotrbak piotrbak added the severity: major Feature is not working as expected and no work around available label Feb 11, 2021
@NataliaDrause
Copy link
Contributor

@CrochetFeve0251 CrochetFeve0251 self-assigned this Apr 7, 2022
@CrochetFeve0251
Copy link
Contributor

@piotrbak We have a problem concerning the grooming here and we discussed with @engahmeds3ed about it.
If the solution works for the changed version and the future ones this won't be applied to previous version that will be still running the old code.
Due to that we need to decide until where it is possible to rollback. Should it be until the updated version or until 2.3.7 that would the problem resurface as soon as the user backup with a version that has the old backup logic.

@NataliaDrause
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [S] 1-2 days of estimated development time module: tools priority: low Issues that can wait severity: major Feature is not working as expected and no work around available type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants