Skip to content

Conversation

@coreymckrill
Copy link
Contributor

Changes proposed in this Pull Request:

With the new version of the Faker library introduced in #147, the behavior of the realTextBetween seems to have changed, making it more strict in its interpretation of the input parameters. This change avoids fatal errors by ensuring that there is always a range of 40 between the specified minimum number of characters and the maximum, so that the generator can always build a string with a length that falls somewhere within the range.

Fixes #153

How to test the changes in this Pull Request:

  1. Before getting started, make sure you're running Smooth Generator with the latest dependencies:
    nvm use && npm run setup
  2. Replicate the issue on trunk. Run wp wc generate terms product_cat 100 and observe the fatal error (there are two different ones you might see, as described in the linked issue). You may have to run it a few times before you get an error.
  3. Check out this branch, and then run the command a few more times. You shouldn't be able to get either of the reported fatal errors anymore.

Changelog entry

Avoid fatal errors that sporadically occurred while generating taxonomy terms

With the new version of the Faker library introduced in #147, the
behavior of the `realTextBetween` seems to have changed, making it more
strict in its interpretation of the input parameters. This change avoids
fatal errors by ensuring that there is always a range of 40 between the
specified minimum number of characters and the maximum, so that the
generator can always build a string with a length that falls somewhere
within the range.
@coreymckrill coreymckrill self-assigned this Dec 30, 2024
Copy link
Member

@jorgeatorres jorgeatorres left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you @coreymckrill!

@jorgeatorres jorgeatorres merged commit bc76a53 into trunk Dec 31, 2024
@jorgeatorres jorgeatorres deleted the fix/153/faker-errors branch December 31, 2024 14:03
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.

Different problems encountered when generating product categories

3 participants