Skip to content

Use originalString when returning the Segment definition string #17610

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

Merged
merged 2 commits into from
May 23, 2021

Conversation

diosmosis
Copy link
Member

@diosmosis diosmosis commented May 21, 2021

Description:

Fixes #17583

The string definition passed into Segment will sometimes be decoded before being saved in Segment::$string. So if we reuse the string to create a new Segment, the new segment's hash will be different. This PR changes getString() to return the original string so we're always using the definition we started with.

EDIT: Modified this PR to not change Segment::getString(), since that resulted in a test failure that looked like a regression. Instead there's a new method. We can replace every occurrence if desired in 4.4.0.

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

…e it can be modified by segment construction.
@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels May 21, 2021
@diosmosis diosmosis added this to the 4.3.1 milestone May 21, 2021
@diosmosis
Copy link
Member Author

An alternative solution here is just to put the urlencode() back in.

@tsteur tsteur merged commit cdbb353 into 4.x-dev May 23, 2021
@tsteur tsteur deleted the 17583-segment-original-string branch May 23, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

Creating/updating segments w/ values w/ encoded chars does not auto schedule rearchiving
2 participants