Closed
Description
Summary:
Currently, the app fetches the user's contributions by:
-
Step 1: querying
logevents
API (ApacheHttpClientMediaWikiApi:logEvents
). This gives thepageid
,filename
anddateUpdated
for user's uploads -
Step 2: Deleted files(the ones with
pageid
0) are skipped and the rest is inserted int thecontributions
db. -
Step 3: To show the list of contributions,
findThumbnailByFilename
is called for each file and the image along with filename is shown.
I propose that we move away from this approach and start consuming imageinfo
API for displaying user's contributions.
Eg:
Pros:
- all meta info(categories, url, thumbnail, author etc) related to the image can be retrieved in a single call.
- paginated response(similar to the log events API)
- Step 2, Step 3 won't be required
- In all probability, we can remove the limitation of showing just 500 images in the app. (Allow dynamic loading of contributions, without number limit #1993)
- The behavior will become similar to the category list and search list
- Will make Show caption instead of filename (in my contributions and Explore) #2525 pretty straightforward to implement
- Will fix Contributions: Same 3 images repeat forever #2892 (Note: There are other ways to fix this. The fix is not entirely dependent)
- Will pave way for Adding a search fragment to search other users by name #2739, as the same fragment can be reused just by replacing the user's name.
- Move closer to Code quality: make contributions and featured activity use same code #1566.
Cons:
- If we want to show deleted images then we will need a way to fetch them. Discussion App displays images which have been deleted #118.
- Still won't address Cache contribution images #2496. We can think of a common caching strategy for images displayed in explore, search and contributions. Obviously, we would be more aggressive in caching contributions.