When naming a collection and a subcollection with the same name, the getRepository function returns incorrect results. This issue arises due to the way getRepository prioritizes collections and subcollections.
Steps to Reproduce
Create a collection and a subcollection with the same name.
Use getRepository to retrieve the repository.
Observe that the incorrect repository is returned.
Expected Behavior
The getRepository function should correctly distinguish between collections and subcollections with the same name, giving priority to collections.
Actual Behavior
The getRepository function returns the wrong repository when collections and subcollections have the same name.
Acceptance Criteria
Modify getRepository to rank collections first, giving them priority over subcollections.
Ensure the function correctly distinguishes between collections and subcollections with the same name.
Add unit tests to verify the correct behavior of getRepository in this scenario.
Additional Context
October 23, 2020: Initial issue raised about the incorrect behavior of getRepository.
November 8, 2020: Acknowledgment of the issue and suggestion to prioritize collections over subcollections.
Description
When naming a collection and a subcollection with the same name, the
getRepository
function returns incorrect results. This issue arises due to the waygetRepository
prioritizes collections and subcollections.Steps to Reproduce
getRepository
to retrieve the repository.Expected Behavior
The
getRepository
function should correctly distinguish between collections and subcollections with the same name, giving priority to collections.Actual Behavior
The
getRepository
function returns the wrong repository when collections and subcollections have the same name.Acceptance Criteria
getRepository
to rank collections first, giving them priority over subcollections.getRepository
in this scenario.Additional Context
getRepository
.Original Issue