Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cold chain: Temperature logs synced to central server are incompatible with existing Dashboard and Notify #2686

Closed
adamdewey opened this issue Jan 9, 2024 · 6 comments
Labels
bug Something is borken Closed: Not needed Not needed anymore feature: coldchain

Comments

@adamdewey
Copy link
Contributor

adamdewey commented Jan 9, 2024

What went wrong? 😲

Temperature logs display on a remote server with the correct time zone, but after being synced to the central server they are displaying with an incorrect time zone (think perhaps no time zone is being applied)

Temperature logs on Cold Chain App:

image

Temperature logs on Open mSupply remote server:

telegram-cloud-photo-size-1-4965322029624569065-y

Temperature logs on central server:

telegram-cloud-photo-size-1-4965322029624569062-y

telegram-cloud-photo-size-1-4965322029624569063-y

image

Expected behaviour 🤔

Time zone should be preserved from CCA through to central server.

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. Set up CCA tablet with a time zone other than UTC
  2. Set up Open mSupply tablet with the same time zone
  3. Set up central server with same time zone (Windows and Postgres DB)
  4. Sync data from CCA tablet to Open mSupply tablet
  5. Sync data from Open mSupply tablet to central server
  6. Observe time zone not preserved

Your environment 🌱

  • CCA Version: 0.5.6
  • Open mSupply version: 1.5.03
  • mSupply version: V7-09-05
  • Postgres version: 13

Trello: https://trello.com/c/AjKVZuTh/242-temperature-logs-coming-across-from-oms-to-central-server-with-incorrect-timezone

@andreievg
Copy link
Collaborator

There is om_datetime field, which should be a UTC timestamp string, we should be using that in dashboards etc.. There are quite a few layers to the cake, cca -> omsupply -> msupply -> dashboard, and on top of that msupply stores date and time separately, and in it's own 4d format that's hard to truly understand.

@adamdewey
Copy link
Contributor Author

adamdewey commented Jan 9, 2024

Thanks @andreievg - yeah we probably need to make sure that anything that uses those Open mSupply temperature datetimes are working correctly - off the top of my head:

  • Dashboards
  • Notify
  • Temperature tables in mSupply Desktop not a valid use case
  • Breach alerts in mSupply Desktop not a valid use case

Although I think the last 2 are edge cases as hopefully we won't have to support hybrid Open mSupply / mSupply Desktop systems for too long

@adamdewey
Copy link
Contributor Author

adamdewey commented Jan 10, 2024

Have updated Dashboards to apply correct timezone:

image

Does mean that we can't support CCA > Open mSupply and CCA > mSupply Desktop on the same dashboard though..

@adamdewey
Copy link
Contributor Author

@jmbrunskill - Notify will need to be updated to be able to cater for both CCA > mSupply Desktop and CCA > Open mSupply > mSupply Desktop.

How should we approach that?

@jmbrunskill
Copy link
Contributor

@jmbrunskill - Notify will need to be updated to be able to cater for both CCA > mSupply Desktop and CCA > Open mSupply > mSupply Desktop.

How should we approach that?

It should probably use the om_datetime if available, once that field exists is it set for every record? Or only on records from open-mSupply? I've created a ticket in notify for this msupply-foundation/notify#282

@adamdewey adamdewey changed the title Cold chain: Temperature logs sync to central server with incorrect time zone Cold chain: Temperature logs synced to central server are incompatible with existing Dashboard and Notify Jan 15, 2024
@andreievg
Copy link
Collaborator

triage: Preference for mSupply to also populate that field when cold chain app sync the data to it. And then updated Dashboards/Notify to reflect this. I think this would be a more reliable and aligned solution going forward.

TODO:

Create issue in mSupply for this + Dashboard, update existing servers.
Close this issue

@AnushaUp AnushaUp added the Closed: Not needed Not needed anymore label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is borken Closed: Not needed Not needed anymore feature: coldchain
Projects
None yet
Development

No branches or pull requests

6 participants