Open ghost opened 3 years ago
Ou, stupid mistake I guess. I am identifying documents just by name so collisions can occur. I think that something as adding timestamp to the name should solve the problem.
If you want, you can create a fix and I will happily integrate it into the repo.
In other case I will try to get to it once I have some free time.
Dne pá 17. 9. 2021 11:26 uživatel plonibarploni @.***> napsal:
I scanned a document with two pages and then I scanned another two page document, but assigned it the same name. This created some confusion in the app which caused the second page of the second document to be added to the first document instead.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Breta01/docus/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOP5YFQ4M3ON3QUAQSOLQTUCKYNFANCNFSM5EGCUUFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I took a quick look around the code but I didn't clearly find the code that manages this, so if you could point me to the code I might be able to propose a fix.
It seems like you're using a database to store the document info, so it might make sense to reference the document internally by it's ID in order to prevent such collisions.
Okay, I was just checking the code. The issue is in:
documentName
to pass around reference to the document between the preview and CameraFragment
dataRepository.findByName(documentName)
which obviously leads to collisionsdocumentName
Adding extra function for finding documents by id (findById
) will be neccessary. This should be placed in following files in a same way as findByName
:
Images of pages are then saved in folder which uses naming convention: documentName-<timestamp>
so that should be ok.
I scanned a document with two pages and then I scanned another two page document, but assigned it the same name. This created some confusion in the app which caused the second page of the second document to be added to the first document instead.