Closed Bug 1790547 Opened 3 years ago Closed 3 years ago

json links ending with ) wrong

Categories

(DevTools :: JSON Viewer, defect, P2)

Firefox 102
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1735545

People

(Reporter: richard, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

When a REST server returns json with links in it, normally you can click on a link and a new tab will open with that link.

For example go to:
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Things?$top=1

Click on
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Things(1)/Locations
working great

Actual results:

NOW click on @iot.selfLink which is a link like
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Things(1)

You will see that (BOTH clicking AND copying it) will bring you to:

https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Things(1

(NOTE THE MISSING ) ON THE END)

(which then gives a 404 because the url is broken)

Expected results:

Clicking or Copying should take the last ) into consideration.

Apparently it is dropped?

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Component: Widget: Gtk → Networking

I cannot reproduce this. Copying and clicking work as expected.

Do you have any WebExtenson installed?

Flags: needinfo?(richard)

Yes, I had some plugins/extensions, but even if I move my .mozilla folder (which for what I know have all plugins/extensions?) and start with a 'fresh' profile, I have the issue.
(see this screenshot: also the tooltip is missing the ending bracket)

Flags: needinfo?(richard)

Note: I run Debian Testing (Gnome on X.org), FIrefox version 102.2.0esr (64-bit)

But (see screenie) I'm also able to reproduce it on a Windows10 VM machine running Firefox in a relatively fresh profile, which runs: 104.0.2 (64-bit)

With your last comments, I understood what you meant and I am able to reproduce it.

This looks like a bug in our JSON parsing code.
Honza, is your team responsible for this code.

Flags: needinfo?(odvarko)

Thank you Dragana, yes, this is DevTools bug

Nicolas, it looks like this line is causing the problem:
https://searchfox.org/mozilla-central/rev/9769b513e38ee4f5df9d5d1eff55ff7cdc8cbf81/devtools/client/shared/components/reps/reps/string.js#249

Blame is showing that this line has been modified by bug: Bug 1669956 - Un-bundle reps
which is just unbundling so likely not the culprit

Similar logic is also used in messages.js file. And blame points to this bug: Bug 1545888 - Use template-styled message with placeholders as group header
Perhaps it might be more helpful.

Any tips how we could fix this?

Honza

Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: Networking → JSON Viewer
Ever confirmed: true
Flags: needinfo?(odvarko) → needinfo?(nchevobbe)
Priority: -- → P2
Product: Core → DevTools
Has STR: --- → yes
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #6)

Thank you Dragana, yes, this is DevTools bug

Nicolas, it looks like this line is causing the problem:
https://searchfox.org/mozilla-central/rev/9769b513e38ee4f5df9d5d1eff55ff7cdc8cbf81/devtools/client/shared/components/reps/reps/string.js#249

Blame is showing that this line has been modified by bug: Bug 1669956 - Un-bundle reps
which is just unbundling so likely not the culprit

Similar logic is also used in messages.js file. And blame points to this bug: Bug 1545888 - Use template-styled message with placeholders as group header
Perhaps it might be more helpful.

Any tips how we could fix this?

Honza

Oriol did some analysis in https://bugzilla.mozilla.org/show_bug.cgi?id=1735545#c2 , the issue is in our code to remove some characters from the URL, so we do linkify the right part in case like there's an issue (see www.bugzilla.com), where we don't want the closing paren to be part of the URL.
We could try to be smarter and not remove such character if there's another "unclosed" pair character (so (, [, ", ', ...), but I don't think we'll ever get something bulletproof

Flags: needinfo?(nchevobbe)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: