Suggestions

:tools:

Streak value available in API

An extra field or specific endpoint in the API returning the count of the most recent ‘streak’ for any attribute, i.e. days since a zero or null value.

It would be great to be able to fetch through the API the number of days that I have updated my mood tracking in a row. This could potentially be added to the JSON returned by API by checking the most recent null entry date and counting from there.

2 votes

Tagged as Development

Suggested 08 January 2022 by user Dayan Graham

  • Sign in to comment and vote. Sign in by email
  • 08 January 2022 Dayan Graham suggested this task

  • avatar

    Hey Dayan, could you give me some more info about your use case for this? Why is it useful, what are you planning to do with it?

    11 January 2022
  • avatar

    I would love to make a small widget on my phone that shows how many days in a row that I have entered my mood into Exist. This will gamify the experience encourage consistent data provision.

    16 January 2022
  • avatar

    Thanks for that. That sounds like you’re after a widget, rather than a value in the API. However if you’re looking to make this yourself, there should be enough information in the API already to calculate the streak length, no?

    17 January 2022
  • avatar

    I guess you’re right, I would be satisfied with a widget. The issue with calculating the streak from the API is 1) A lack of persistence means the streak must be derived each time from the timestamps 2) The calculation of the streak on the client-side will be expensive as one has to recurse through the paginated metrics to calculate the streak. I suspect it could be cleaner and easier to implement server-side.

    21 January 2022
  • 24 January 2022 Josh Sharp approved this task

  • avatar

    I’ve changed the suggestion to make it more generic, I think providing this value is something we could accommodate without too much fuss. Cheers!

    24 January 2022