]> cat aescling's git repositories - mastodon.git/commit
Improve searching for private toots from URL
authorThibaut Girka <thib@sitedethib.com>
Mon, 21 Sep 2020 16:22:54 +0000 (18:22 +0200)
committerThibG <thib@sitedethib.com>
Thu, 12 Nov 2020 22:44:30 +0000 (23:44 +0100)
commit10bd6f415df1459a03daf42a11d42e0b78bf8a1e
tree14d20731cae9af08d0ee5aa970584fc4f1e51be7
parent3b6e27978d5d8851845c5c15bbe8162b998f59d3
Improve searching for private toots from URL

Most of the time, when sharing toots, people use the toot URL rather than
the toot URI, which makes sense since it is the user-facing URL.

In Mastodon's case, the URL and URI are different, and Mastodon does not
have an index on URL, which means searching a private toot by URL is done
with a slow query that will only succeed for very recent toots.

This change gets rid of the slow query, and attempts to guess the URI from
URL instead, as Mastodon's are predictable.
app/services/resolve_url_service.rb