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

Issue with media upload #1290

Closed
AchalaBelokar opened this issue Feb 6, 2024 · 8 comments
Closed

Issue with media upload #1290

AchalaBelokar opened this issue Feb 6, 2024 · 8 comments
Assignees

Comments

@AchalaBelokar
Copy link

AchalaBelokar commented Feb 6, 2024

Describe the bug
I am login with AchalaB@power user and then create a user
and then try to sync this but showing sync timeout error

To Reproduce
Steps to reproduce the behavior:

  1. login with AchalaB@power
  2. Register a Individual with adding a profile photo
  3. click on sync
  4. you will get sync timeout error

Expected behavior
user is able to sync the app

Screenshots

az_recorder_20240206_233957.mp4

Logs:

02-06 09:14:41.439  8796  8843 D ReactNativeJS: [9:14:41:439] [DummySync][Debug] Performing Dummy no-op sync, as user triggered manual sync is already in-progress
02-06 09:14:41.564  8796  8843 D ReactNativeJS: [9:14:41:564] [MediaQueueService][Debug] Uploading media to https://s3.ap-south-1.amazonaws.com/prerelease-user-media/power/376cd128-7924-4c22-8e71-463dae32c76d.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240207T070959Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=600&X-Amz-Credential=AKIARXEEBLNOF4BOVO4I%2F20240207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=48d91159f12412ace300659405e06b109dc63bee6957ef36763e1f930dc07985
02-06 09:14:41.814  8796  8843 D ReactNativeJS: [9:14:41:814] [MediaQueueService][Debug] 376cd128-7924-4c22-8e71-463dae32c76d.jpg uploadProgress 10240/272706
02-06 09:14:42.384  8796  8843 D ReactNativeJS: [9:14:42:384] [MediaQueueService][Debug] Upload of 5ea3a245-2eaa-4219-b2ae-8506b3187907 - 376cd128-7924-4c22-8e71-463dae32c76d.jpg done
02-06 09:14:42.384  8796  8843 D ReactNativeJS: [9:14:42:384] [MediaQueueService][Debug] Replacing observation with value https://s3.ap-south-1.amazonaws.com/prerelease-user-media/power/376cd128-7924-4c22-8e71-463dae32c76d.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240207T070959Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=600&X-Amz-Credential=AKIARXEEBLNOF4BOVO4I%2F20240207%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=48d91159f12412ace300659405e06b109dc63bee6957ef36763e1f930dc07985
02-06 09:14:42.427  8796  8843 E ReactNativeJS: 'MediaQueueService', 'undefined, "Error while uploading 5ea3a245-2eaa-4219-b2ae-8506b3187907 - 376cd128-7924-4c22-8e71-463dae32c76d.jpg"'
02-06 09:14:42.428  8796  8843 E ReactNativeJS: 'MediaQueueService', 'Exception in HostFunction: Accessing object of type EmbeddedKeyValue which has been invalidated or deleted, {}', 'Error: Exception in HostFunction: Accessing object of type EmbeddedKeyValue which has been invalidated or deleted\n    at get_key (native)\n    at get (address at index.android.bundle:1:826088)\n    at create (native)\n    at create (address at index.android.bundle:1:1093786)\n    at anonymous (address at index.android.bundle:1:1623765)\n    at write (native)\n    at write (address at index.android.bundle:1:1094342)\n    at updateObservations (address at index.android.bundle:1:1623673)\n    at replaceObservation (address at index.android.bundle:1:1536364)\n    at anonymous (address at index.android.bundle:1:1536718)\n    at tryCallOne (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/MinSizeRel/1h352kp3/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)\n    at anonymous (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/MinSizeRel/1h352kp3/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)\n    at apply (native)\n    at anonymous (address at index.android.bundle:1:246556)\n    at _callTimer (address at index.android.bundle:1:245550)\n    at _callReactNativeMicrotasksPass (address at index.android.bundle:1:245715)\n    at callReactNativeMicrotasks (address at index.android.bundle:1:247626)\n    at __callReactNativeMicrotasks (address at index.android.bundle:1:97689)\n    at anonymous (address at index.android.bundle:1:96828)\n    at __guard (address at index.android.bundle:1:97566)\n    at flushedQueue (address at index.android.bundle:1:96739)\n    at invokeCallbackAndReturnFlushedQueue (address at index.android.bundle:1:96682)'
02-06 09:14:42.429  8796  8843 E ReactNativeJS: 'SyncComponent-Sync', 'syncTimeoutError, {}', 'Error: syncTimeoutError\n    at anonymous (address at index.android.bundle:1:1537576)\n    at tryCallOne (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/MinSizeRel/1h352kp3/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)\n    at anonymous (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/MinSizeRel/1h352kp3/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)\n    at apply (native)\n    at anonymous (address at index.android.bundle:1:246556)\n    at _callTimer (address at index.android.bundle:1:245550)\n    at _callReactNativeMicrotasksPass (address at index.android.bundle:1:245715)\n    at callReactNativeMicrotasks (address at index.android.bundle:1:247637)\n    at __callReactNativeMicrotasks (address at index.android.bundle:1:97689)\n    at anonymous (address at index.android.bundle:1:96828)\n    at __guard (address at index.android.bundle:1:97566)\n    at flushedQueue (address at index.android.bundle:1:96739)\n    at invokeCallbackAndReturnFlushedQueue (address at index.android.bundle:1:96682)'
02-06 09:14:42.441  8796  8843 D ReactNativeJS: [9:14:42:441] [SyncComponent::AC][Debug] Dispatching action: "SyncTelemetryActions.SYNC_FAILED"
02-06 09:14:42.457  8796  8843 D ReactNativeJS: [9:14:42:457] [SyncComponent::AC][Debug] Dispatched action completed: "SyncTelemetryActions.SYNC_FAILED" {"syncing":true,"isConnected":{"details":{"isConnectionExpensive":BELOW_DEPTH,"txLinkSpeed":BELOW_DEPTH,"rxLinkSpeed":BELOW_DEPTH,"linkSpeed":BELOW_DEPTH,"subnet":BELOW_DEPTH,"ipAddress":BELOW_DEPTH,"frequency":BELOW_DEPTH,"strength":BELOW_DEPTH,"bssid":BELOW_DEPTH},"isConnected":true,"type":"wifi","isInternetReachable":true,"isWifiEnabled":true},"progress":0,"message":"Uploading saved media files (0/1)","syncMessage":"syncingData","startSync":false,"backgroundSyncInProgress":false,"startTime":1707191081331}
02-06 09:14:42.457  8796  8843 D ReactNativeJS: [9:14:42:457] [SyncComponent::AC][Debug] Dispatching action: "SYNC.ON_ERROR"
02-06 09:14:42.466  8796  8843 D ReactNativeJS: [9:14:42:466] [SyncComponent::AC][Debug] Dispatched action completed: "SYNC.ON_ERROR" {"syncing":false,"isConnected":{"details":{"isConnectionExpensive":BELOW_DEPTH,"txLinkSpeed":BELOW_DEPTH,"rxLinkSpeed":BELOW_DEPTH,"linkSpeed":BELOW_DEPTH,"subnet":BELOW_DEPTH,"ipAddress":BELOW_DEPTH,"frequency":BELOW_DEPTH,"strength":BELOW_DEPTH,"bssid":BELOW_DEPTH},"isConnected":true,"type":"wifi","isInternetReachable":true,"isWifiEnabled":true},"progress":0,"message":"Uploading saved media files (0/1)","syncMessage":"syncingData","startSync":false,"backgroundSyncInProgress":false,"startTime":1707191081331}
02-06 09:14:42.467  8796  8843 W ReactNativeJS: registerHeadlessTask or registerCancellableHeadlessTask called multiple times for same key 'syncJob'
02-06 09:14:42.470  8796  8843 I ReactNativeJS: [9:14:42:470] [AvniBackgroundJob-SyncJobSchedule][Info] Successfully scheduled
02-06 09:14:42.519  8796  8843 I ReactNativeJS: [9:14:42:519] [Sync][Info] Starting background sync
02-0

Analysis:

Looks like some issue with embedded objects story when trying to upload media.

@github-project-automation github-project-automation bot moved this to New Issues in Avni Product Feb 6, 2024
@mahalakshme mahalakshme moved this from New Issues to Ready in Avni Product Feb 7, 2024
@mahalakshme mahalakshme changed the title In the power unable to sync after creating individual Issue with media upload Feb 7, 2024
@mahalakshme mahalakshme removed the bug label Feb 7, 2024
@himeshr himeshr self-assigned this Feb 7, 2024
@himeshr himeshr moved this from Ready to In Progress in Avni Product Feb 7, 2024
@himeshr
Copy link
Contributor

himeshr commented Feb 7, 2024

Avni-client logs captured after reproducing the issue.

EmbeddedObjectsMediaSyncError.txt

@himeshr
Copy link
Contributor

himeshr commented Feb 8, 2024

Vaidated following test cases:

  1. Create of individual with profile-pic
  2. Update of profile-pic for individual
  3. Attaching new media content as observation field to individual
  4. Removing / updating media from individual observation
  5. Adding media for program enrolment
  6. Removing / updating media from program enrolment

@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Feb 8, 2024
@1t5j0y 1t5j0y moved this from Code Review Ready to In Code Review in Avni Product Feb 8, 2024
@1t5j0y
Copy link
Contributor

1t5j0y commented Feb 8, 2024

@himeshr not required in EncounterService and ProgramEncounterService ?

@himeshr
Copy link
Contributor

himeshr commented Feb 9, 2024

@himeshr not required in EncounterService and ProgramEncounterService ?
The objects sent in EncounterService and ProgramEncounterService updateObservations() are the complete realmObjects and they do not have an issue when the mode is set to "true"( which corresponds to Realm.UpdateMode.All).

@1t5j0y 1t5j0y moved this from In Code Review to QA Ready in Avni Product Feb 9, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Feb 9, 2024
@AchalaBelokar
Copy link
Author

  • I created one user Tim Tim which is having a profile picture which is visible on client but not visible on web app

Image

Image

@AchalaBelokar AchalaBelokar moved this from In QA to QA Failed in Avni Product Feb 9, 2024
himeshr added a commit that referenced this issue Feb 9, 2024
himeshr added a commit that referenced this issue Feb 9, 2024
… ensure all modifications are saved including profile-pic which is outside observations, but with Realm.UpdateMode.Modified flag, to only effect delta change on the realmDB
@himeshr himeshr moved this from QA Failed to Code Review Ready in Avni Product Feb 9, 2024
@himeshr
Copy link
Contributor

himeshr commented Feb 9, 2024

We were missing out on update of profile-pic due to partial update of only observations as part of post-media update flow.
Have made the correction to now do update of whole entity.

@petmongrels petmongrels moved this from Code Review Ready to In Code Review in Avni Product Feb 13, 2024
@petmongrels petmongrels moved this from In Code Review to QA Ready in Avni Product Feb 13, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Feb 14, 2024
@AchalaBelokar
Copy link
Author

  • I assigned this task to AchalaB@power but it is not reflected on client
  • [ ]

Image

Image

@AchalaBelokar AchalaBelokar moved this from In QA to QA Failed in Avni Product Feb 14, 2024
@himeshr himeshr moved this from QA Failed to In Progress in Avni Product Feb 14, 2024
@himeshr
Copy link
Contributor

himeshr commented Feb 14, 2024

On debug, did not face this issue. Could have been due to partial first sync,as the time taken to complete full sync for user AchalaB@power is very high, and app might have been closed in between.

Test with maha user which has smaller catchment.

@himeshr himeshr moved this from In Progress to QA Ready in Avni Product Feb 14, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to Done in Avni Product Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants