cssat / sprout-issues

An issue-only repository for the Sprout data collection platform
https://sproutservices.org
2 stars 1 forks source link

Visit report history export missing updatedAt field value (timestamp) #193

Closed subaykan closed 2 years ago

subaykan commented 2 years ago

When downloading 'Report History' from a Sprout Visit Report, the CSV spreadsheet file has blanks in the cells where we expect to see "updated at"

See screenshot:

Screenshot from 2022-07-13 15-18-40

Should display a time value, this is saved in the database as a timestamp with timezone data type, e.g.

updatedAt | 2022-02-18 21:14:33.106+00

debugging with the application log in dev, I see that this value is retrieved from the db:

14:35:05 api.1    |     updatedAt: 2022-02-18T21:14:33.106Z,

This value is being dropped in the processing of this data for display in the export function (the download button which builds the spreadsheet)

subaykan commented 2 years ago

I have a workaround that seems to fix this, in my development environment

The simple fix produces this timestamp value for the 'Updated At' field:

Screenshot from 2022-07-13 14-42-57

If desired, we can apply a different formatting to the timestamp, with fewer details. However, this should suffice to fix the bug.

subaykan commented 2 years ago

Deploying to UAT a fix which displays the 'Updated At' in a more friendly format:

Screenshot from 2022-07-14 13-54-15

subaykan commented 2 years ago

PR for fix: https://github.com/cssat/sprout/pull/121

subaykan commented 2 years ago

Deployed to prod 7/19

subaykan commented 2 years ago

Reopening this, as this change seems to have caused a new problem in visit reports. When a new visit report is created, the udpatedAt field gets saved and/or displayed with the wrong timestamp (ref zendesk ticket 19422). example: at 7/22 14:22 PDT, creating a visit report shows that it was last saved at 07/22/22, 9:22 PM PDT -

Will revisit this issue and look for a fix that avoids this

subaykan commented 2 years ago

PR for new fix: cssat/sprout#122

subaykan commented 2 years ago

Deployed to prod 7/26