I explored using User pages as a storage mechanism for the minimal
viable product for the collections work the mobile team is doing. The
goal is to prove the success of the feature and then feed our findings
into the multiple lists in core RFC.

I completed a proof of concept patch for storing collections as lists.
Essentially it stores all the meta data associated with a users
collection as a page at User:<username>/MobileWebCollections.json

You can test it out by:
1) checking out: https://gerrit.wikimedia.org/r/#/c/188225/
2) visiting Special:MobileCollections
3) refreshing page and seeing a collection with 2 items in it

Whilst doing this I have discovered that potentially race conditions
could be an issue with this approach. The sample code carries out
various transactions and the end state can differ based on which
finish first. I'm not much of a PHP expert so I'm not sure how to
remedy this problem. It may not be a problem based on the fact that we
only anticipate one user managing these lists at a given time.

Apart from the race condition it seems to work nicely. I imagine the
API could also be used to handle watchlist watch and unwatch actions
so that we wouldn't have nasty special cased code for watching
articles.

Currently the API is only designed to work on private lists for the
current user. I would expect a user parameter to be added later.

Let me know if you have any questions.

_______________________________________________
Mobile-l mailing list
Mobile-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mobile-l

Reply via email to