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

Accept id on attachments, actions when creating dialogs #1623

Open
5 tasks done
Tracked by #1138
elsand opened this issue Dec 18, 2024 · 0 comments
Open
5 tasks done
Tracked by #1138

Accept id on attachments, actions when creating dialogs #1623

elsand opened this issue Dec 18, 2024 · 0 comments
Assignees

Comments

@elsand
Copy link
Member

elsand commented Dec 18, 2024

Introduction

In order to be able to idempotently handle changes to attachment lists (on both dialog and transmissions) and api/gui actions, we need to be able to support user supplied attachment ids.

Description

The Altinn 3 integration aims to idempotently map any instance to a corresponding dialog, including all attachments and actions. As the list of attachments/actions is mutable, we need to be able to determine whether or not a given attachment/action to a instance is new, updated or deleted compared to the list of attatchments/actions on the dialog. We can dervice a UUIDv7 from the instance attachment id/action urls/other unique data, and thus achieve idempotency. The update command support supplying ids, but as of now the create command does not. This issue describes expanding createdialogcommand to accept ids on the attachments and action sub entities.

See also Slack discussion, notably:

Si at en TE henter en dialog med 5 GuiActions og skal til å gjøre endringer på den siste GuiActionen i lista via patch. I mellomtiden har det blitt lagt til en GuiAction. Dersom id var bestemt av DP ville den garangtert bli lagt bakerst i GuiAction lista og dermed ikke påvirket den kommende patchen. Men dersom vi åpner opp for brukerdefinerte ider kan den nye GuiAction bli lagt til på et vilkårlig sted i dialogens GuiAction liste. Dette vil påvirke patchen som targeter elementet på index, og ikke på id. Redningen her er at patch brukes sammen med if-match header.

Implementation

In addition to adding Id to the create command DTOs, EnsureNoExistingUserDefinedIds needs to be expanded.

Tasks

Preview Give feedback

Threat modelling

Preview Give feedback

Acceptance criteria

GIVEN a create dialog command contains one or more attachments or actions with user-defined IDs
WHEN the command is processed
THEN the new attachments or actions must be persisted with the provided IDs, ensuring no duplicates exist across the dialog

GIVEN a create dialog command that does not specify an ID for an attachment or an action
WHEN the command is processed
THEN the system must generate and persist a unique ID for that attachment or action

GIVEN a create dialog command or update dialog command with user-defined IDs
WHEN any ID provided conflicts with an already existing user-defined ID in the same dialog
THEN the command must fail with a clear error message indicating the conflict

@elsand elsand moved this from New issues to Backlog in Dialogporten / Arbeidsflate - GAMMEL Dec 18, 2024
@elsand elsand changed the title Accept id on attachments Accept id on attachments when creating dialogs Jan 6, 2025
@elsand elsand changed the title Accept id on attachments when creating dialogs Accept id on attachments, actions when creating dialogs Jan 7, 2025
@elsand elsand moved this from Backlog to Ready in Dialogporten / Arbeidsflate - GAMMEL Jan 8, 2025
@elsand elsand marked this as a duplicate of #1622 Jan 8, 2025
@Fargekritt Fargekritt self-assigned this Jan 8, 2025
@Fargekritt Fargekritt moved this from Ready to Doing in Dialogporten / Arbeidsflate - GAMMEL Jan 8, 2025
@Fargekritt Fargekritt moved this from Doing to Code Review og PR in Dialogporten / Arbeidsflate - GAMMEL Jan 9, 2025
@elsand elsand moved this to Code Review og PR in Dialogporten / Arbeidsflate - NY Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review og PR
Development

No branches or pull requests

2 participants