FHIR
FHIR copied to clipboard
Ensure sort is stable
Is your feature request related to a problem? Please describe. In https://github.com/LinuxForHealth/FHIR/issues/3888 we saw some test failures in our sort testing when the server environment started handing out the same lastUpdated time to multiple resources.
Describe the solution you'd like Perform further testing to ensure that our sorts are always stable. If not, this could break our paging.
Describe alternatives you've considered Perform paging using some other approach to ensure stability (e.g. via some variant of https://github.com/LinuxForHealth/FHIR/issues/3476)
Acceptance Criteria
- GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]
Additional context
Initial check can be done by looking at our queries (e.g. when _sort=_lastUpdated) and verifying if we have an implicit secondary sort in the query.
If we do #3591 then the unstable sort is less concerning because it will at least be consistent across the paged results of a single search.