LibrePass / LibrePass-iOS

LibrePass Application for iOS
GNU General Public License v3.0
9 stars 1 forks source link

Question: Storing data in the app #5

Closed warmachinesocial closed 7 months ago

warmachinesocial commented 8 months ago

Want to ask you that why don't we store the cipher using core data or swift data?

aeoliux commented 8 months ago

Why would we?

warmachinesocial commented 8 months ago

Why would we?

  1. If we want user to use the app without network connectivity
  2. If we don't store them then are we wanting to up the db every time? However when we multiple devices we could fall into concurrency issues though i haven't looked much into the entire codebase.
  3. Every time when the cipher gets updated we only need to check for the network connectivity and make sure that is the user authenticated or not.
aeoliux commented 8 months ago

If you read the code, you would know that we use UserDefaults to store data. And it works, so why would we have to change the way

warmachinesocial commented 8 months ago

Yes I just read it now, user defaults is meant for something small like state changes on top of that we have to store either in keychain or a database using coredata just because of security side of things going on. I would have to say that currently it's a wrong approach.

UserDefault stores everything in plaintext, that's complete opposite of what to want achieve.

aeoliux commented 8 months ago

Ok. If you really want it, implement it.

aeoliux commented 7 months ago

@warmachinesocial I'm cleaning up code and adopting new API, so I can implement SwiftData or CoreData. After I pull changes from newAPI branch, the code can be much different.

warmachinesocial commented 7 months ago

I have made a refactoring branch on code to show swiftui view and viewmodel. Plus at this stage I have removed the pods library and used swift package library, very few changes to it. So just want to confirm with you if you're fine it? If not no worries then will work on my fork version

aeoliux commented 7 months ago

I don't want to change too much at the same time. Now I'm totally changing the way how app works because of SwiftData. For now LibrePassAPI handles data saving, but I need to completely make API separate from saving data and I have to move it to SwiftUI views. Sounds easy, but this app isn't prepared for it at all. After that, I will look what you did. At the moment I don't have real iOS device (I'm going to buy one), so I can't test biometrical authentication and QR code scanner. That's what I really need, not refactoring code. I would really appreciate if you could implement it (if you have real iOS device).

warmachinesocial commented 7 months ago

@aeoliux No worries I would try my best to put the features slowly and I would still work on my branch, when it gets ready will raise the PR

aeoliux commented 7 months ago

@warmachinesocial I have implemented SwiftData, so should this issue be closed?