Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request id is truncated to 16 characters #6669

Open
sys-alex-matic opened this issue Jan 31, 2025 · 0 comments
Open

Request id is truncated to 16 characters #6669

sys-alex-matic opened this issue Jan 31, 2025 · 0 comments

Comments

@sys-alex-matic
Copy link

Describe the bug
When calling create/update, the request id is persisted but tables are limited to 16 characters which it not enough for an UUID. As a result the request id is not persisted correct and in our specific scenario it is causing problems as meta.source relies on requestId - See below. In general the cut-off is also a problem regarding tracking by the request id as the whole id is not persisted.

Our scenario:

  1. Calling create/update for a resource. The requestId is an UUID(assigned by istio/envoy) and the UUID is returned in the meta.source with full length but only 16 characters is persisted.
  2. Calling update with the response from the create/update call will contain a payload with the full UUID in meta.source but our update method fetches the persisted resource and in some scenarios we want to ensure only specific fields has been modified. That means the payload contains the full UUID in meta.source but the persisted resource has the cut-off requestId which is mapped to meta.source and causing meta.source not being equal.

hapifhir:
Method handleRequest in class RestFulServer assigns request id from request header X-Request-ID to RequestDetails.requestId. Later on the requestId is persisted in HFJ_RES_VER and HFJ_RES_VER_PROV but limited to 16 characters but the request id is an UUID which is cut-off when persisted.

RequestDetails:
RestfulServer.handleRequest
calls getOrCreateRequestId which will get id from either X-Request-ID or generate a randomAlphaNumeric - a 16 character id in that case.

Call stack for create (master branch):
BaseHapiFhirResourceDao.doCreateForPost
BaseHapiFhirResourceDao.doCreateForPostOrPut
BaseHapiFhirDao.updateEntity
BaseHapiFhirDao.createHistoryEntry
MetaUtil.populateResourceSource

Expected behavior
The X-Request-ID header is persisted in full length meaning the database should support at least UUID length and maybe longer to be more flexible?

Environment
HAPI FHIR Version: v. 6.10.5 (REQUEST_ID still limited to 16 characters on master branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant