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

Adding support to have p2p #300

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Adding support to have p2p #300

wants to merge 4 commits into from

Conversation

magp18
Copy link

@magp18 magp18 commented Nov 17, 2022

More of a work around to have p2p by having a button to download and upload data.
So one would download, share via bluetooth and the peer would upload when connected to the internet.

Support for exporting / importing data using UI
Added JS functions to prepare document when exporting it
@garethbowen
Copy link
Member

Thanks @magp18 ! It's really interesting to see this starting to come together.

Some ideas for further development...

  1. I have some concerns about private health information being stored and shared in plaintext. There are a few different ways to solve this but it looks like at the moment the user's data doesn't need to be readable by the supervisor's phone, so the way I'd be looking to solve this is by using some shared key encryption that is unique to the user, so they can encrypt it, and API can have a special endpoint to decrypt it and sync it. This also makes the solution more flexible because you wouldn't necessarily need a CHT app to transfer it.
  2. Currently this is a one-way sync - the data on the offline device is never updated. This will make it difficult to roll out app updates and fixes, but also means doc via sentinel, api, or other users will never get through. This will make conflicts more and more likely over time. If you could figure out a way to do bi-directional sync that would be a significant breakthrough!
  3. The data transfer doesn't stream to/from disk which means with a large enough database the phone will run out of memory. It would be better to fetch a page of the database at a time and append to the file on disk.
  4. Because you're using allDocs the package will get larger and larger over time with data that the server is already up to date on. A better approach would be to find some way to store the sequence, and then use the _changes feed with the since parameter to get only updated files.
  5. This is more a minor comment but I think it'd be better to move the upload and download buttons into the webapp so they can be hidden in the hamburger menu or similar and not take up screen realestate for what is likely to be a rarely used feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants