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

Duplicate delete dialog calls should return 410 GONE, not 404 NOT FOUND #1541

Open
oskogstad opened this issue Nov 29, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@oskogstad
Copy link
Collaborator

oskogstad commented Nov 29, 2024

Reproduction

Delete a dialog by ID, repeat the action

Expected behavior

410 GONE

Actual behavior

404 NOT FOUND

@oskogstad oskogstad added the bug Something isn't working label Nov 29, 2024
@oskogstad oskogstad moved this to Code Review og PR in Dialogporten / Arbeidsflate Nov 29, 2024
@oskogstad oskogstad self-assigned this Nov 29, 2024
@oskogstad oskogstad changed the title Duplicate delete dialog calls should return 410 GONE, not 404 NOT FOUND Duplicate delete dialog calls should return 400 BAD REQUEST, not 404 NOT FOUND Nov 29, 2024
oskogstad added a commit that referenced this issue Nov 29, 2024
)

<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #1541 

## Verification

- [x] **Your** code builds clean without any errors or warnings
- [x] 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)
@oskogstad oskogstad moved this from Code Review og PR to Testing / Design QA in Dialogporten / Arbeidsflate Nov 29, 2024
@arealmaas arealmaas moved this from Testing / Design QA to Done in Dialogporten / Arbeidsflate Dec 2, 2024
@arealmaas arealmaas closed this as completed by moving to Done in Dialogporten / Arbeidsflate Dec 2, 2024
@arealmaas arealmaas moved this from Done to Testing / Design QA in Dialogporten / Arbeidsflate Dec 2, 2024
@arealmaas arealmaas moved this from Testing / Design QA to Doing in Dialogporten / Arbeidsflate Dec 2, 2024
@arealmaas arealmaas reopened this Dec 2, 2024
@oskogstad oskogstad changed the title Duplicate delete dialog calls should return 400 BAD REQUEST, not 404 NOT FOUND Duplicate delete dialog calls should return 410 GONE, not 404 NOT FOUND Dec 2, 2024
oskogstad added a commit that referenced this issue Dec 2, 2024
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Related Issue(s)

- #1541 

## Verification

- [x] **Your** code builds clean without any errors or warnings
- [x] 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)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced `410 Gone` response status for `DELETE`, `PUT`, and `POST`
operations related to dialog management, enhancing clarity on resource
deletion.
- Added specific responses for deleted dialogs in various endpoints,
improving error handling.

- **Bug Fixes**
- Updated response handling in dialog update and delete operations to
return more accurate status when dealing with deleted entities.

- **Tests**
- Modified tests to reflect changes in response expectations for
attempts to update deleted dialogs.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@oskogstad oskogstad moved this from Doing to Testing in Dialogporten / Arbeidsflate Dec 5, 2024
@LeifHelstad
Copy link

Test:

Ser at det er diskutert litt mellom 400, 404 og 410 her i saken.

Akkurat i dag oppleves 400. Det oppfatter jeg som feil. (Var ønsket 29.nov men ønket ble endret en time senere)

Opprette dialog:
200 Created
"0193c008-0fb5-750d-9ece-55ac58de15cb"
Slette samme 1. gang
204 No Content
Slette samme 2. gang
400 Bad Request
{
"type": "https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"instance": "/api/v1/serviceowner/dialogs/0193c008-0fb5-750d-9ece-55ac58de15cb",
"errors": {
"BadRequest": [
"Entity 'DialogEntity' with key '0193c008-0fb5-750d-9ece-55ac58de15cb' has already been removed and cannot be deleted again."
]
},
"traceId": "00-2c65f2854be9816637a5c396cb44006d-d3e8d453b4fde455-01"
}

@LeifHelstad
Copy link

Det kan virke som det har vært problemer med deployment til staging miljøet de siste fem dagene (minst). Men at problemet er løst siste døgn og at det er kommet en vellykket deploy av versjon 1.42.0 for 16 timer siden.

Test:

Nå blir resultatet av 2. delete som forventet - Test Passed:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Testing
Development

No branches or pull requests

3 participants