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

Ability to Dump Application's Database #2360

Closed
qiarie opened this issue Dec 8, 2023 · 8 comments
Closed

Ability to Dump Application's Database #2360

qiarie opened this issue Dec 8, 2023 · 8 comments
Assignees
Labels
P2 Medium priority issue type:enhancement New feature or request

Comments

@qiarie
Copy link
Collaborator

qiarie commented Dec 8, 2023

Is your feature request related to a problem? Please describe.

We have experienced sync issues due to malformed resources, caused by some references not properly set such as missing the resource type before the reference. Resources with such issues fail to sync since the referenced resources are not found on the server.

Identifying the cause of the failing sync has proven hard, especially when we are unable to reproduce the issue on our staging environment.

Describe the solution you'd like

To make troubleshooting possible for cases that are hard to reproduce, we would like a copy of the application's database to be downloadable to device storage for further investigations.

The dumped database file should be encrypted with a password that is defined by the app calling the database download SDK API.

Describe alternatives you've considered

  • Our implementation for a quick release to unblock an issue involved duplicating class com.google.android.fhir.db.impl.DatabaseEncryptionKeyProvider.kt in FHIRCore to allow us access the encrypted database.
  • The encrypted password is then decrypted and copied to a plaintext database file. The plaintext file is zipped with a password and is availed for saving to file or sharing

Additional context

Add any other context or screenshots about the feature request here.

Would you like to work on the issue?

Please state if this issue should be assigned to you or who you think could help to solve this issue.

@santosh-pingle santosh-pingle added type:enhancement New feature or request P2 Medium priority issue labels Dec 11, 2023
@jingtang10 jingtang10 self-assigned this Dec 11, 2023
@dubdabasoduba
Copy link
Collaborator

@jingtang10 please feel free to review the PR On OpenSRP. I think we want to move that kind of functionality to the SDK

@qiarie
Copy link
Collaborator Author

qiarie commented Apr 2, 2024

@jingtang10 We would like to revisit this issue and have the feature in the SDK. Please review the issue and share your thoughts.

@santosh-pingle
Copy link
Collaborator

santosh-pingle commented Apr 4, 2024

Can you please discuss this issue in today's developer call? @simon Njoroge @aditya Khajuria @madhuram Jajoo

@MJ1998
Copy link
Collaborator

MJ1998 commented Apr 7, 2024

We are happy to add this ability. Along with this there should also be a way for application to modify data before dump - so a plugin which application can implement and register.

Can you tell us how you are doing this in the PR linked above.
Would you work on this @qiarie ?
Thanks.

@MJ1998
Copy link
Collaborator

MJ1998 commented Apr 9, 2024

@qiarie
We also wanted to understand the use-case more. Questions are around difference between staging and prod environment - and the possibility of replicating the scenario to troubleshoot the sync issue in prod environment ?
For example, one could upload all the logs to troubleshoot, no ?

@qiarie
Copy link
Collaborator Author

qiarie commented Apr 15, 2024

Hello @MJ1998.

We are happy to add this ability. Along with this there should also be a way for application to modify data before dump - so a plugin which application can implement and register.

This is noted. Do you mind giving more information on there should also be a way for application to modify data before dump - so a plugin which application can implement and register.

Can you tell us how you are doing this in the PR linked above. Would you work on this @qiarie ? Thanks.

I will check with my team and share an update

@qiarie
Copy link
Collaborator Author

qiarie commented Apr 15, 2024

@MJ1998

@qiarie We also wanted to understand the use-case more. Questions are around difference between staging and prod environment - and the possibility of replicating the scenario to troubleshoot the sync issue in prod environment ? For example, one could upload all the logs to troubleshoot, no ?

In our current use case and implementation, a user is able to initiate a raw database download to the file system.

For debug versions, the database is unencrypted and is saved as is to the file system.
For release versions, the app's database is encrypted. An empty database file is created. The encrypted database is read and its contents copied to the empty DB file.

In both cases, the database is zipped and a ZIP password set.

@MJ1998
Copy link
Collaborator

MJ1998 commented May 21, 2024

After internal discussions and careful evaluation, we've decided not to implement the database dump feature at this time. This decision aligns with our core principle of maintaining a secure, encrypted database environment. Additionally, we believe this feature may become less relevant as our sync capabilities mature.

@MJ1998 MJ1998 closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Medium priority issue type:enhancement New feature or request
Projects
Status: Complete
Development

No branches or pull requests

5 participants