Page MenuHomePhabricator

API for streak for SE v3
Open, HighPublic5 Story Points

Description

Current streak that they are on - if they are on one
Most recent edit

If the user is not presently on a streak, show the date they last edited. Otherwise show current streak length.

Do not need to record longest ever streak.

Copy from: T231449

If streak is below 2 days, the interface outputs a date stamp (local format) of the last edit and the label changes to “Last edited": Check out this visual on Zeplin that conveys the idea.

Details

Related Gerrit Patches:
operations/mediawiki-config : masterWikimediaEditorTasks: Enable streaks and revert counts in production
mediawiki/extensions/WikimediaEditorTasks : masterFeature flag for edit streaks
mediawiki/extensions/WikimediaEditorTasks : masterAPI for streak for SE v3

Event Timeline

Charlotte created this task.Oct 8 2019, 4:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 8 2019, 4:22 PM
Charlotte triaged this task as High priority.Oct 8 2019, 4:28 PM
Charlotte updated the task description. (Show Details)
Charlotte renamed this task from Endpoint for streak for SE v3 to API for streak for SE v3.Oct 8 2019, 4:52 PM
Charlotte updated the task description. (Show Details)Oct 22 2019, 4:08 PM
Charlotte set the point value for this task to 5.

Change 545432 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[mediawiki/extensions/WikimediaEditorTasks@master] [WIP] API for streak for SE v3

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

cooltey updated the task description. (Show Details)Thu, Oct 24, 6:25 AM

The API response now will look like below:

{
  "batchcomplete": true,
  "query": {
    "wikimediaeditortaskscounts": {
      "counts": {
        "app_description_edits": {
          "en": 1,
          "fr": 1,
          "zh": 1
        }
      },
      "edit_streak": {
        "length": 2,
        "last_edit_time": "20191024215011"
      }
    }
  }
}

I add a new edit_streak that contains two attributes: length and last_edit_time in it.

When a user submits the first description/caption, the length will be 0, and the last_edit_time will be updated every time when making a change.

If the user submits descriptions/captions within 2 days (compares with the last_edit_time), the length will +1 when every edit made.

If the user submits descriptions/captions within 2 days (compares with the last_edit_time), the length will +1 when every edit made.

It shouldn't be for every edit, surely? The streak length measures the number of days with at least 1 edit, and should only increment once a day no matter how many edits are made on that day.

It shouldn't be for every edit, surely? The streak length measures the number of days with at least 1 edit, and should only increment once a day no matter how many edits are made on that day.

You're right. I've modified the logic to:

  1. Default streak length after making 1st edit: 1.
  2. +1 streak length only if : 1 day <= current_edit_time - last_edit_time < 2 days
  3. Do nothing if the user makes more edits on that day.
  4. Reset to 1 if a new edit is made after 2 days.

Change 545432 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEditorTasks@master] API for streak for SE v3

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

The API was completed and there's no QA/Design signoff needed, so moved it to Blocked/Waiting column to waiting for the actual implementation on the Android side.

Change 546709 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[mediawiki/extensions/WikimediaEditorTasks@master] Feature flag for edit streaks

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

Change 546709 merged by jenkins-bot:
[mediawiki/extensions/WikimediaEditorTasks@master] Feature flag for edit streaks

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

Change 548832 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[operations/mediawiki-config@master] WikimediaEditorTasks: Enable edit streaks in production

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

Mentioned in SAL (#wikimedia-operations) [2019-11-06T00:07:16Z] <mdholloway> created table wikimedia_editor_tasks_edit_streak on x1/wikishared (T234956)

Change 548832 merged by Mholloway:
[operations/mediawiki-config@master] WikimediaEditorTasks: Enable streaks and revert counts in production

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

Mentioned in SAL (#wikimedia-operations) [2019-11-06T14:41:18Z] <mholloway-shell@deploy1001> Synchronized wmf-config/InitialiseSettings.php: WikimediaEditorTasks: Enable streaks and revert counts (T234955, T234956) (duration: 01m 00s)