-
Notifications
You must be signed in to change notification settings - Fork 22
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
Avni Entity Observation Media fields not present in S3 #1156
Comments
Able to reproduce this issue by interrupting network during media sync (turn data off/on, airplane mode on/off) while on a slow connection. This results in the images not being successfully upload and a 'Broken pipe' message in the logs after approx 10 mins which is not treated as an error by the library we are using to upload images (rn-fetch-blob) and the happy path (updating observations with s3 url etc) proceeds. Fixes tried:
Fix being worked on:
|
- Timeout media upload if there is no progress - Add timeout to get signed url upload call - Propagate media upload errors to stop subsequent data sync
This is a behaviour change from before. Earlier, we did not treat s3 failures as a blocker for sync of regular transactional data. Because of this, if you have an S3 downtime, users will not be affected. These images will be uploaded at a later time when S3 becomes available. This change could potentially bring in probems we might earlier have had with the s3 upload to the foreground. Propose moving forward with this comment. |
We have the option of including the change to timeout uploads that are not making progress and removing the error propagation if we want to retain previous sync behaviour (don't fail sync if media sync has issues). Few potential issues if we do so are:
|
Test scenarios:
Check to see that data sync does not proceed if media sync fails. |
Hi Joy, Vinay has stated in his comment, that though this is a change in behaviour, we should still go ahead with it. |
Yes, I got that. No confusion. Was just highlighting that we still have the option to do this in an incremental way without changing the sync behaviour and the potential issues. |
Oh okay. While making the chocie, i would like to reiterate Goonj's perspective that, its critical that media uplaod failures are recorded correctly and there are no missing files in S3. |
Describe the bug
We see that there are several Media objects that are missing in S3 folder of the organisation, corresponding to Avni entities (Subject , Encounter, etc..) observation fields.
These show up as broken image-panes in Media-viewer.
To Reproduce
Root-cause is unknown and also steps for reproduction are not known as of now.
Expected behavior
As part of Avni-client sync, we should always upload the Media to S3 and update the Observation fields with the S3 url, after that. If not done, fail Sync till we can do that.
There after, we should not have missing S3 media content corresponding to observation fields of any entity.
Screenshots
Additional context
We had recently done some optimizations with Avni-client Media Upload. This could have resulted in missing out some media content uploads in corner case scenrios. This is just an assumption, which should be taken up as a starting point.
**APK details **
- Only use Goonj Revamp UAT org users for attempting issue reproduction. Do not use Goonj Prod users for any debug or development.
Developer Checklist
Developer fixing the bug should fill this checklist.
The text was updated successfully, but these errors were encountered: