Page MenuHomePhabricator

Increase the max length of URL to be shortened
Open, Needs TriagePublic

Description

Currently the maximum size for the URL to be shortened on the URL shortener is 2,000 characters. This is not enough for some Wikidata queries that main contain up to 4000 characters. My suggestion is to increase the limit to 10K and see if there are some use cases of longer URLs.

(example of query)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 11 2019, 2:29 PM
Lea_Lacroix_WMDE updated the task description. (Show Details)

Two other long queries are linked in T163683#3913304 – 1448 and 4850 characters.

Hi,
first, sry if this is written on the wrong page:
There must be put intention in that this could really easy missused by linking a very big file with https://de.wikipedia.org/[FILE] . For example I used it to link some (sry for that joke I will never do it again) comments like w.wiki/Jt.

@Habitator_terrae This is why the Meta stewards have the ability to delete a link is this present security or personal data protection issues, for example.

agray added a subscriber: agray.Apr 12 2019, 9:32 AM

This would help solve another problem - at the moment the existing third-party shortener embedded in the query service returns a 431 error for queries which are longer than ~3000 characters.

(It's usually possible to cut a query to get it under this limit but it means that sometimes there's an incentive to remove whitespace, comments, etc, which can be counterproductive)

Is there any absolute length on what the query service will handle via the URL? If so, we should perhaps use that to define the upper limit on what's acceptable for the URL shortener.

This comment was removed by Lucas_Werkmeister_WMDE.

Is there any absolute length on what the query service will handle via the URL? If so, we should perhaps use that to define the upper limit on what's acceptable for the URL shortener.

I don’t think so, though eventually it has to switch how it submits the query to the backend (T216590).

@Habitator_terrae This is why the Meta stewards have the ability to delete a link is this present security or personal data protection issues, for example.

If the link lenght would be grow up to 4000, link like w.wiki/uR (an File in Base64 code between []) would become more effective. So it could be missused for sharing also other content, that has nothing to do with wikimedia. This very problematic, because the size of the short links grow, when the size of the numbers of the short links grow. And I don't see how Steward could fix this alone.

This is not enough for some Wikidata queries that main contain up to 4000 characters. My suggestion is to increase the limit to 10K and see if there are some use cases of longer URLs.

After a certain point we're just creating an arbitrary text store, with little oversight and visibility. I don't really want to deal with the abuse potential of 10k characters.

I don't really think gigantic URLs are the best way to share SPARQL queries tbh, but that's a bit off topic for this task.

I don't really think gigantic URLs are the best way to share SPARQL queries

In case anyone is wondering, a work-around is to put the query on a wiki page and use a short URL for that page; like this:

https://w.wiki/vj

Framawiki added a subscriber: Framawiki.
TheDJ added a subscriber: TheDJ.Apr 29 2019, 10:09 AM

It should also be noted that the max url length for IE/Edge for instance is still 2047 characters even to this day.

I don't really think gigantic URLs are the best way to share SPARQL queries

In case anyone is wondering, a work-around is to put the query on a wiki page and use a short URL for that page; like this:

https://w.wiki/vj

This is a good workaround for a link to the query, but we cannot make a link to the results page this way.

Jheald added a comment.May 8 2019, 8:07 AM

The other workaround, of course, is just to copy & paste the URL into tinyurl, which seems able to take at least 4500 characters -- but that is something of a step back to square 1.

+1 for this. Further example of a long SPARQL report is at https://twitter.com/Tagishsimon/status/1128769104674996234 fwiw