Skip to content
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

Closed
fox1t opened this issue Mar 3, 2020 · 0 comments 路 Fixed by #1880
Closed

Use uniquely generated code instead of progressive number #1876

fox1t opened this issue Mar 3, 2020 · 0 comments 路 Fixed by #1880
Assignees
Labels
馃悰bug issue/pull request that documents/fixes a bug good first issue indicates an issue is good for a first time contributor

Comments

@fox1t
Copy link
Member

fox1t commented Mar 3, 2020

馃悰 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

@fox1t fox1t added the 馃悰bug issue/pull request that documents/fixes a bug label Mar 3, 2020
@fox1t fox1t added the good first issue indicates an issue is good for a first time contributor label Mar 3, 2020
@jackcmeyer jackcmeyer self-assigned this Mar 4, 2020
jackcmeyer added a commit that referenced this issue Mar 4, 2020
BREAKING CHANGE: Any patient saved with friendly id will no longer map friendly id to the patient
object, thus not displaying it in the UI or have it available for search

fix #1876
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
馃悰bug issue/pull request that documents/fixes a bug good first issue indicates an issue is good for a first time contributor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants