This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
Use uniquely generated code instead of progressive number #1876
Labels
🐛bug
issue/pull request that documents/fixes a bug
good first issue
indicates an issue is good for a first time contributor
🐛 Bug Report
Since CouchDB is a really distributed database, we need to be sure that unique fields are really unique, even if two distinct users adds same resource at the same time.
Starting from this postulate, the method https://github.com/HospitalRun/hospitalrun-frontend/blob/master/src/clients/db/PatientRepository.ts#L7 doesn't respects it. This is a recommandation coming both, from PouchDB and CouchDB docs.
To Reproduce
Steps to reproduce the behavior:
Two users add a new user at the same time, and PouchDB/CouchDB sync is fired at the same time.
Expected behavior
friendlyId
tocode
The text was updated successfully, but these errors were encountered: