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

[WC2-478] Using source_created_at and source_updated_at instead of their server… #1581

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

madewulf
Copy link
Member

@madewulf madewulf commented Aug 24, 2024

See ticket here: https://bluesquare.atlassian.net/browse/WC2-478

The problem is the wrong ordering of visits in this screen
Screenshot_20240824-143247 (1)

As a solution: sending source_created_at and source_updated at to the mobile phones in the mobile entity API because we were sending the update and creation date from the server, which hides the timing between visits at WFP, which is problematic because this timing is essential to find out if a beneficiary is late.

Self proofreading checklist

  • Did I use eslint and black formatters
  • Is my code clear enough and well documented
  • Are there enough tests

How to test

Upload and download entity on the mobile app

Print screen / video

@madewulf madewulf marked this pull request as ready for review August 24, 2024 18:39
@madewulf madewulf changed the title Using source_created_at and source_updated_at instead of their server… [WC2-478] Using source_created_at and source_updated_at instead of their server… Aug 24, 2024
updated_at = serializers.SerializerMethodField()

def get_created_at(self, instance):
return instance.source_created_at.timestamp() if instance.source_created_at else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would do the trick yes, but maybe fallback to created_at just in case would be best

madewulf and others added 2 commits August 26, 2024 11:42
@bramj bramj force-pushed the hotfix-updated-at-date-for-entities branch from 8dc4ec8 to 37e6190 Compare August 26, 2024 09:42
bramj added 2 commits August 26, 2024 13:48
when updating an instance via Enketo.
To facilitate the fetching of source_created/update_at with fallback to
DB timestamps.
Should make it easier to avoid mistakes in the future.
@bramj
Copy link
Contributor

bramj commented Aug 26, 2024

@madewulf I've added a fix for when a form is edited with Enketo (creation with Enketo was already okay) and I went further to ensure we have the correct timestamp, while not sending None to the mobile app.
I also noticed we needed the same fix on reference instances.

@bramj bramj added the release Should be released in production at next deploy label Aug 27, 2024
@bramj bramj merged commit e3eda01 into main Aug 27, 2024
3 checks passed
@bramj bramj deleted the hotfix-updated-at-date-for-entities branch August 27, 2024 11:44
@kemar kemar removed the release Should be released in production at next deploy label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants