Page MenuHomePhabricator

URL shortener error for long URLs
Closed, DuplicatePublic

Description

Very long WikiData URLs are returning the output: "[object Object]". URL example below. Is this a simple fix or something difficult? Also mentioned at https://meta.wikimedia.org/wiki/Talk:Wikimedia_URL_Shortener.

https://query.wikidata.org/#PREFIX%20gas%3A%20%3Chttp%3A%2F%2Fwww.bigdata.com%2Frdf%2Fgas%23%3E%0A%0A%23defaultView%3AGraph%0A%23%20parts%20of%20a%20gene%20and%20their%20subclasses%0ASELECT%20DISTINCT%20%3Fdown%20%3FdownLabel%20%3Fup%20%3FupLabel%20%28%22%23ff0000%22%20AS%20%3Frgb%29%20WHERE%20%7B%0A%20%20%7B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20SELECT%20%3Fdown%20%3Fup%20WHERE%20%7B%20%23%20subclass%20of%20untranslated%20region%0A%20%20%20%20%20%20%20%20SERVICE%20gas%3Aservice%20%7B%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AgasClass%20%22com.bigdata.rdf.graph.analytics.BFS%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Ain%20wd%3AQ424345.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AtraversalDirection%20%22Reverse%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout%20%3Fdown.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout1%20%3Fdepth.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout2%20%3Fup.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AlinkType%20wdt%3AP279.%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20SELECT%20%3Fdown%20%3Fup%20WHERE%20%7B%20%23%20subclass%20of%20regulatory%20sequence%0A%20%20%20%20%20%20%20%20SERVICE%20gas%3Aservice%20%7B%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AgasClass%20%22com.bigdata.rdf.graph.analytics.BFS%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Ain%20wd%3AQ3238407.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AtraversalDirection%20%22Reverse%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout%20%3Fdown.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout1%20%3Fdepth.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout2%20%3Fup.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AlinkType%20wdt%3AP279.%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20SELECT%20%3Fdown%20%3Fup%20WHERE%20%7B%20%23%20part%20of%20coding%20region%0A%20%20%20%20%20%20%20%20SERVICE%20gas%3Aservice%20%7B%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AgasClass%20%22com.bigdata.rdf.graph.analytics.BFS%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Ain%20wd%3AQ3780824.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AtraversalDirection%20%22Reverse%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout%20%3Fdown.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout1%20%3Fdepth.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout2%20%3Fup.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AlinkType%20wdt%3AP361.%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20UNION%0A%20%20%7B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20SELECT%20%3Fdown%20%3Fup%20WHERE%20%7B%20%23%20instance%20of%20regulatory%20sequence%0A%20%20%20%20%20%20%20%20SERVICE%20gas%3Aservice%20%7B%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AgasClass%20%22com.bigdata.rdf.graph.analytics.BFS%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Ain%20wd%3AQ424345.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AtraversalDirection%20%22Reverse%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout%20%3Fdown.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout1%20%3Fdepth.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout2%20%3Fup.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AlinkType%20wdt%3AP31.%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20%20UNION%0A%20%20%7B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20SELECT%20%3Fdown%20%3Fup%20WHERE%20%7B%20%23%20part%20of%20gene%0A%20%20%20%20%20%20%20%20SERVICE%20gas%3Aservice%20%7B%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AgasClass%20%22com.bigdata.rdf.graph.analytics.BFS%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Ain%20wd%3AQ7187.%20%23%20gene%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AtraversalDirection%20%22Reverse%22.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout%20%3Fdown.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout1%20%3Fdepth.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3Aout2%20%3Fup.%0A%20%20%20%20%20%20%20%20%20%20gas%3Aprogram%20gas%3AlinkType%20wdt%3AP361.%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%2Cda%2Csv%2Cjp%2Czh%2Cru%2Cfr%2Cde%22.%20%7D%0A%7D

Event Timeline

Additional note: In mobile mode, I also get the warning "The URL is too long, the maximum size is 2,000 characters". This doesn't appear in the desktop version.

It also seems counter-intuitive, given that one would most want a url shortener for longer urls! Especially since the query.wikidata.org creates such long ones.

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/UrlShortener/+/master/extension.json See the end of the file (line 137). Maybe this needs to be bumped up. It could b made configurable I guess.

I'd be happy to see it raised an order of magnitude. Is there a possible negative application or security risk that it is aiming to avoid?

What would the process be for deciding whether the character limit can be raised?

Good question. Adding @Legoktm for comments. (Please feel free to take yourself off and redirect us if you're not the right person for this.)

I join Thomas in wondering. In particular, a common use case where one would get very long and legitimate URLs is Wikidata queries. Those long URLs are the only way to persist a query.