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

Segment editor may fail with URIError: URI malformed #14943

Closed
tsteur opened this issue Oct 2, 2019 · 0 comments · Fixed by #14952
Closed

Segment editor may fail with URIError: URI malformed #14943

tsteur opened this issue Oct 2, 2019 · 0 comments · Fixed by #14952
Assignees
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Oct 2, 2019

While testing #14884 I noticed an error in the segment editor. Likely it's a regression.

It fails with the error

angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:123 URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at findAndExplodeByMatch (segmentgenerator.controller.js?cb=21177de8310fa51319dd14c492d0bdea:50)
    at SegmentGeneratorController.setSegmentString (segmentgenerator.controller.js?cb=21177de8310fa51319dd14c492d0bdea:262)
    at SegmentGeneratorController (segmentgenerator.controller.js?cb=21177de8310fa51319dd14c492d0bdea:273)
    at Object.invoke (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:44)
    at O.instance (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:94)
    at q (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:69)
    at angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:81
    at angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:136
    at m.$digest (angular.min.js?cb=21177de8310fa51319dd14c492d0bdea:147)

in plugins/SegmentEditor/angularjs/segment-generator/segmentgenerator.controller.js around line 50 where the value of newMetric is {"segment":"browserCode","matches":"==","value":"<'>/\"#$I*%"}

image

In the DB I have the segment defined like this

INSERT INTO `piwik_segment` (`idsegment`, `name`, `definition`, `login`, `enable_all_users`, `enable_only_idsite`, `auto_archive`, `ts_created`, `ts_last_edit`, `deleted`)
VALUES
	(28, '&lt;&#039;&gt;/&quot;#$I*%', 'browserCode==%3C%27%3E%2F%22%23%24I*%25', 'root', 0, 1, 0, '2016-09-29 10:36:08', '2016-09-29 11:36:22', 0);

I suppose the problem is that the value might be decoded twice? not sure. When I debug it does the decode twice though (if (minPos < metric.length) {)

image

@tsteur tsteur added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Oct 2, 2019
@tsteur tsteur added this to the 3.12.0 milestone Oct 2, 2019
@katebutler katebutler self-assigned this Oct 3, 2019
@mattab mattab changed the title Segmenteditor fails Segment editor may fail with URIError: URI malformed Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants