feat(privacy-types): add RequestIdAlreadyExists DsrErrorCode - #445
feat(privacy-types): add RequestIdAlreadyExists DsrErrorCode#445mason-hale wants to merge 1 commit into
Conversation
Add REQUEST_ID_ALREADY_EXISTS plus its DSR_ERROR_MESSAGE builder so bulk DSR create can reject an existing requestId unless isRestart is true.
@transcend-io/airgap.js-types
@transcend-io/cli
@transcend-io/design-tokens
@transcend-io/internationalization
@transcend-io/privacy-types
@transcend-io/sdk
@transcend-io/type-utils
@transcend-io/utils
@transcend-io/mcp
@transcend-io/mcp-server-admin
@transcend-io/mcp-server-assessment
@transcend-io/mcp-server-base
@transcend-io/mcp-server-consent
@transcend-io/mcp-server-discovery
@transcend-io/mcp-server-docs
@transcend-io/mcp-server-dsr
@transcend-io/mcp-server-inventory
@transcend-io/mcp-server-preferences
@transcend-io/mcp-server-workflows
commit: |
michaelfarrell76
left a comment
There was a problem hiding this comment.
cant we just assume passing a requestId means isRestart=true?
|
@michaelfarrell76 we do that for the bulk REST endpoint, attaching the flag on the sombra ingress when requestId is provided by a customer. but this isn’t possible for graphQL (which already passes isRestart=true; the whole convention of this flag was introduced to distinguish between a restart and between Sombra creating a new request as it passes requestId with the encryptedCEKContext). this is addressing an outstanding small bug where if graphQL passes an existing requestId without isRestart=true, it will upsert and overwrite the request, which we don’t want to happen. see ticket for more details, but yeah |
|
this is really just capturing a narrow internal/graphQL case brought up by annalisa here: https://github.com/transcend-io/main/pull/47483#pullrequestreview-4952929677 if you’re wondering why isRestart is necessary at all, it has to do with the CEK context stuff introduced by annalisa back in april; i went on a bit of a deep dive. |
Mason is correct about us needing to pass
So |
|
ok @mason-hale @iamtheluckyest i am fine to document this, but if the intention for the REST API is to not expose isRestart and requestId always means isRestart=true, and this is just an implementation detail of the transcend <> sombra api, then i'd probably just throw a normal error in that situation rather than using the code. the codes are going to be primarily for different situations that the customer should handle in their code. |
|
@michaelfarrell76 i'm gonna close this for now given the error doesn't arise from the public API - i'll just throw a normal error in the other PR. lmk if you'd rather this come in and i can re-open |
Important
Small, high-priority review: additive type-only change (no behavior changes) that blocks WAL-10697 on main, mirroring #417.
Summary
DsrErrorCode.RequestIdAlreadyExists(REQUEST_ID_ALREADY_EXISTS) with aDSR_ERROR_MESSAGEbuilder.requestIdwithoutisRestart: true.DsrErrorCodere-export after Version Packages publishes and the yarn catalog is bumped.Test plan
pnpm run --dir packages/privacy-types testpnpm run --dir packages/privacy-types typecheck