Page MenuHomePhabricator

Verify that Echo handles SUL gracefully
Closed, ResolvedPublic

Description

The push notifications infrastructure will connect push subscriptions with wiki user's central (not local) ID.

We need to ensure that all unread messages from all wikis for a given central user can be gathered with a single API request, and not separate API requests to every production wiki.

AC

  • Document the API request(s) needed to gather all unread notifications from all wikis for a central user account.

Notes

  • This may require some looking into the Android code and the existing Echo extensionware.
  • This runs for the cross-Wikipedia case, but also for the non-Wikipedias. For apps consumers they may only care about Wikipedias, but the non-apps consumers they may care about everything...or may not.

Conclusion

Echo does handle SUL gracefully. It's necessary to set notwikis parameters to * to have every unread notification available from a specific User with central id configured, source.

Example request:

The Android app also needs the actual name of the wikis that have unread notifications, e.g. "English Wikipedia", "French Wikipedia", etc., to fulfill the design requirement of showing a message like "You have 2 unread messages on English Wikipedia".

Example request:

Event Timeline

Mholloway updated the task description. (Show Details)
Mholloway updated the task description. (Show Details)

It seems that the following API call works from any project:

It's necessary to set notwikis parameters to * to have every unread notification available from a specific User with central id configured, source

The output looks like this:

{
    "batchcomplete": "",
    "query": {
        "notifications": {
            "list": [
                {
                    "wiki": "enwiki",
                    "id": 144742716,
                    "type": "thank-you-edit",
                    "category": "thank-you-edit",
                    "section": "message",
                    "timestamp": {
                        "utciso8601": "2018-09-05T15:43:48Z",
                        "utcunix": 1536162228,
                        "unix": "1536162228",
                        "utcmw": "20180905154348",
                        "mw": "20180905154348",
                        "date": "5 setembro"
                    },
                    "title": {
                        "full": "User:MSantos (WMF)/Testing maps",
                        "namespace": "User",
                        "namespace-key": 2,
                        "text": "MSantos (WMF)/Testing maps"
                    },
                    "agent": {
                        "id": 33959466,
                        "name": "MSantos (WMF)"
                    },
                    "targetpages": []
                },
                {
                    "wiki": "mediawikiwiki",
                    "id": 802732,
                    "type": "edit-thank",
                    "category": "edit-thank",
                    "section": "message",
                    "timestamp": {
                        "utciso8601": "2018-09-05T19:21:20Z",
                        "utcunix": 1536175280,
                        "unix": "1536175280",
                        "utcmw": "20180905192120",
                        "mw": "20180905192120",
                        "date": "5 September"
                    },
                    "title": {
                        "full": "Developers/Maintainers",
                        "namespace": "",
                        "namespace-key": 0,
                        "text": "Developers/Maintainers"
                    },
                    "agent": {
                        "id": 790805,
                        "name": "WikiUser"
                    },
                    "revid": 2871389,
                    "read": "20180918184054",
                    "targetpages": []
                },
                {
                    "wiki": "ptwiki",
                    "id": 12478560,
                    "type": "login-fail-known",
                    "category": "login-fail",
                    "section": "alert",
                    "timestamp": {
                        "utciso8601": "2018-09-08T22:40:15Z",
                        "utcunix": 1536446415,
                        "unix": "1536446415",
                        "utcmw": "20180908224015",
                        "mw": "20180908224015",
                        "date": "8 setembro"
                    },
                    "agent": {
                        "id": 2108176,
                        "name": "MSantos (WMF)"
                    },
                    "read": "20180918183835",
                    "targetpages": []
                }
            ],
            "continue": null
        }
    }
}

Thanks, for the investigation, @MSantos. One thing I've noticed from looking at the Android app code in the past is that it appears to be doing a two-step process: first making a call to get the list of wikis with unread notifications, and then making the call. It would be interesting to find out from them why they're doing that rather than just using notwikis=*, and memorialize it here.

I asked @Dbrant and the reason behind doing two-step process is

[...] to get the actual names of the wikis that have unread notifications, e.g. "English Wikipedia", "French Wikipedia", etc., to fulfill the design requirement of showing a message like "You have 2 unread messages on English Wikipedia".

He also said that we could combine the 2 requests, something like the following:

I will update the task with the conclusion.