There is now an option to sort the feed entires by updated_at, on the
controler : a sort querystring argument that accepts either "created"
or "updated".
I've noticed that the endpoint `/api/entries/exists` used by the "Sweep
articles" feature on the Android app failed almost all the time on my
instance.
After checking the corresponding method I found that
`EntryRestController::getEntriesExistsAction()` could be improved.
Here is the former way the method worked:
```
for id in [list of ids]
get full entry by id
if null
get full entry by given id
return array of ids or array of hashes
```
With this behavior on my instance I could expect up to 13k SQL requests
when sweeping articles from the Android app. Morever the repository
fetches all fields (content included) while the method only returns ids
or hashes.
The new behavior is described as follow:
```
get ids, hashes by [list of ids]
merge with provided [list of ids] // this part will complete the final
// array with not found ids
return array of ids or array of hashes
```
In my case this change reduces the number of SQL requests to only 135
(_considering one request for 50 articles_)
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Add IgnoreOriginUserRule for user-defined rules and
IgnoreOriginInstanceRule for system-wide rules. Add an interface for
these two new entities.
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
When using `OR` in a where clause, a composite index can't be used. We should use a `UNION` to take advantages of it.
Instead, create 2 indexes on each hashed urls and make 2 queries to find an url. It'll be faster than the previous solution.
- Added index on entry table for given_url field
- Fix tests:
The previous `bit.ly` url redirected to doc.wallabag but that url doesn't exist in the fixtures.
I used our own internal "redirector" to create a redirect to an url which exist in the fixtures.
Also, updating current migration to use the new `WallabagMigration`.
detail=metadata will nullify the content field of entries in order to
make smaller responses.
detail=full keeps the former behavior, it sends the content of entries.
It's the default, for backward compatibility.
Fixes#2817
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Instead of fetching one domain, we use the same method as in site config (to retrieve the matching file) and handle api.example.org, example.org, .org (yes the last one isn’t useful).
If one of these match, we got it and use it.