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

Strips semantic version information in GSS version check #2041

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

antonis
Copy link

@antonis antonis commented Jun 29, 2021

WordPress-Android PR: wordpress-mobile/WordPress-Android#14963

Description

This PR works around the limitation of our Version utility in handling semantic versions (e.g. 5.8-beta4-51251) by stripping the extra information and keeping only the numeric version string (e.g. 5.8). This applies only in the specific use case of checking the WordPress software version number for enabling GSS.

To test

Reproduce the crash

  1. Use the app from the GSS Android PR
  2. Turn on the GlobalStyleSupportFeatureConfig (Me > App Settings > Test feature configuration)
  3. Select a WP.com (now at version5.8-beta4) site or a self-hosted site with beta WordPress version
  4. Try to open the editor
  5. Notice that the app crashes

Verify the fix

  1. Use the app from this PR
  2. Turn on the GlobalStyleSupportFeatureConfig (Me > App Settings > Test feature configuration)
  3. Select a WP.com (now at version5.8-beta4) site or a self-hosted site with beta WordPress version
  4. Try to open the editor
  5. Verify that the app does not crash

@antonis antonis requested review from geriux and mkevins June 29, 2021 07:51
@antonis antonis self-assigned this Jun 29, 2021
wordPressSoftwareVersion.substringBefore("-")
} else wordPressSoftwareVersion
Version(version) >= Version(GSS_LIMIT_VERSION)
} catch (e: IllegalArgumentException) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea to add this bit of robustness. 👍

Copy link
Contributor

@mkevins mkevins left a comment

Choose a reason for hiding this comment

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

The changes look good. Thanks for adding this fix Antonis!

I tested this by reproducing on develop and confirmed that this fixed the issue.

GlobalStyleSupportFeatureConfig = false true
develop ✔️ 💥
fix/gss-version-check ✔️ ✔️

@mkevins mkevins merged commit d1a7a4f into develop Jun 30, 2021
@mkevins mkevins deleted the fix/gss-version-check branch June 30, 2021 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants