-
Notifications
You must be signed in to change notification settings - Fork 3
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
New revision of dialog available in response header after change #1611
Comments
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> ## Related Issue(s) - #1611 ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable)
@LeifHelstad Ser du en Etag-header? |
Test(Lette etter ETag på feil sted i første testforsøk. Sjekket response headers i nettleser og ikke i postman web klient. Leter rett nå.) Case 1:Ny dialog: "01945f94-1716-707b-ae38-fdd0d2671d17" Case 3:Legger til en Transmission på dialog "01945f94-1716-707b-ae38-fdd0d2671d17" Negative Case:Skader dialogid fra ved å bytte siste 17 med 28 "01945f94-1716-707b-ae38-fdd0d2671d28" |
Introduction
Whenever a part of the dialog aggregate is changed, causing a new revision to made, the new revision should be made available to callers
Description
In order for a client to keep track of revisions, whenever a POST is performed for a new dialog, a PUT/PATCH is performed on an existing dialog, or a POST is performed to add a transmission or activity, the updated revision id should be made available in a HTTP response header.
Implementation
As this is a custom reponse header, it should be prefixed withx-
, such asx-dialog-new-revision-id
Using
ETag
standard: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETagTasks
Threat modelling
Acceptance criteria
Case 1: New Dialog Created
GIVEN a client performs a POST request to create a new dialog,
WHEN the dialog is successfully created,
THEN the response includes an
Etag
header containing the new revision ID.Case 2: Existing Dialog Updated
GIVEN a client performs a PUT or PATCH request to update an existing dialog,
WHEN the update is successful and a new revision is created,
THEN the response includes an
Etag
header containing the updated revision ID.Case 3: Transmission or Activity Added
GIVEN a client performs a POST request to add a transmission or activity to a dialog,
WHEN the addition is successful and a new revision is created,
THEN the response includes an
Etag
header containing the new revision ID.Negative Case: No Revision Created
GIVEN a client performs any of the above requests,
WHEN the operation fails or does not result in a new revision being created,
THEN the response does not include the
Etag
header.The text was updated successfully, but these errors were encountered: