Page MenuHomePhabricator

Add 'seenTime' values for alert/message in the API when fetching list of notifications
Closed, ResolvedPublic

Description

We can treat it as section-based if notgroupsection is triggered, and combined object if the result is not grouped.

Something like this would be useful:

{
  query: {
    notifications: 
      list: [ ... ],
      seenTime: {
         alert: "2016-07-20T02:47:11Z",
         message: "2016-07-20T02:49:37Z"
      }
    }
}

or if grouped,

{
  query: {
     notifications: {
         alert: {
             list: [ ... ],
             seenTime:  "2016-07-20T02:47:11Z"
         },
         message: {
             list: [ ... ],
             seenTime: "2016-07-20T02:49:37Z"
         }
     }
  }
}

Although in the current code, we're not really using notgroupbysection, but it would be good to support that behavior anyways.

Event Timeline

Mooeypoo created this task.Jul 11 2016, 6:57 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 11 2016, 6:57 PM

Two notes:

  1. It will be omitted from the output if it's false, because this is how the API handles false values. If we start using formatversion=2, it will instead explicitly have a false value.
  2. The output format will be ISO per https://www.mediawiki.org/wiki/API:Data_formats#Timestamps .

Change 299935 had a related patch set uploaded (by Mattflaschen):
Add seen time to output of API, in ISO 8601 format

https://gerrit.wikimedia.org/r/299935

Change 299935 merged by jenkins-bot:
Add seen time to output of API, in ISO 8601 format

https://gerrit.wikimedia.org/r/299935

Change 300176 had a related patch set uploaded (by Mattflaschen):
Allow requesting TS_ISO_8601 for ApiEchoMarkSeen, and deprecate TS_MW

https://gerrit.wikimedia.org/r/300176

Change 300176 merged by jenkins-bot:
Allow requesting TS_ISO_8601 for ApiEchoMarkSeen, and deprecate TS_MW

https://gerrit.wikimedia.org/r/300176

@Mattflaschen-WMF - in betalabs 1.28.0-alpha (46a2d3a), the following warning is displayed when the flyoutis expanded - should it be there?

{warnings: {echomarkseen: {,…}},…}
query
:
{echomarkseen: {result: "success", timestamp: "20160721171957"}}
warnings
:
{echomarkseen: {,…}}
echomarkseen
:
{,…}
*
:
"The MW timestamp output format is deprecated here. In the future, ISO 8601 will always be used for
 the output timestamp format.  Adjust your client and set timestampFormat to 'ISO_8601'."

On Special:Notifications page the same warning is present too.

{warnings: {echomarkseen: {,…}, main: {*: "HTTP used when HTTPS was expected"}},…}
query
:
{echomarkseen: {result: "success", timestamp: "20160722003804"}}
echomarkseen
:
{result: "success", timestamp: "20160722003804"}
result
:
"success"
timestamp
:
"20160722003804"
echomarkseen: {,…}, main: {*: "HTTP used when HTTPS was expected"}}
echomarkseen
:
{,…}
*
:
"The MW timestamp output format is deprecated here. In the future, ISO 8601 will always be used for the output timestamp format.  Adjust your client and set timestampFormat to 'ISO_8601'."
main

@Mattflaschen-WMF - in betalabs 1.28.0-alpha (46a2d3a), the following warning is displayed when the flyoutis expanded - should it be there?

Known issue. It's just a warning. @Mooeypoo will make a change to fix it, this is part of our plan.

@Mattflaschen-WMF - in betalabs 1.28.0-alpha (46a2d3a), the following warning is displayed when the flyoutis expanded - should it be there?

Known issue. It's just a warning. @Mooeypoo will make a change to fix it, this is part of our plan.

Opened a followup ticket to adjust the front-end T141115: Change "seenTime" format to ISO 8601 in Notifications front-end

jmatazzoni closed this task as Resolved.Jul 22 2016, 5:27 PM