Open JeremiahSanders opened 5 months ago
Thanks for the report @JeremiahSanders, do you have a fix already in place that could be PR'ed?
@kennethmyhra : Unfortunately, no, I don't have a PR-able fix.
However, after additional testing, I discovered that there is a problem with version-aware updates within FHIR transaction requests. (I submitted that separately, under #714 .) I mention that because there may be some aspect of that issue's resolution which might impact how this issue is resolved. I.e., my workaround of stripping the prefix and suffix from the header's value before submission to IFhirService.UpdateAsync(IKey,Resource)
might conflict with whatever resolution is identified for #714 .
Describe the bug Per HL7 R4 documentation,
Resource
VersionId
values, when included in headers, are considered "weak ETags" (source).In the reference
FhirController
implementation, the header value is simply extracted as-is (without stripping offW/"
and trailing"
). ReferenceSpark.Web
source.NOTE: This is not a bug in the Spark package itself; rather it's a problem in the reference
Spark.Web
implementation.This results in errors when performing version-aware updates. Spark rejects the request because the version from the request contains the weak ETag formatting.
To Reproduce
Steps to reproduce the behavior:
Hl7.Fhir.R4
NuGet package and itsFhirClient.UpdateAsync
withversionAware
parameter set totrue
toHTTP PUT
the updated version (requires the server to use theSpark.Web
code linked above).Expected behavior Expectation is that the update will be accepted if the submitted resource version matches current on the server.
Spark version
2.1.0
Operating system + Database
Container service / Cloud infrastructure:
Additional context I have successfully verified that Spark handles the version correctly if the header parsing is corrected. E.g., via use of a
"""^W/"(\d+)"$"""
Regex
to extract the id from the weak ETag.