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

fix: Allow new activities to reference old activities #935

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

oskogstad
Copy link
Collaborator

@oskogstad oskogstad commented Jul 27, 2024

Description

It is currently not possible to create a new DialogActivity that refers to an old DialogActivity via relatedActivityId
This check in the validator requires the referred Id to be present in the DTO, which we don't allow.

        RuleForEach(x => x.Activities)
            .IsIn(x => x.Activities,
                dependentKeySelector: activity => activity.RelatedActivityId,
                principalKeySelector: activity => activity.Id)
            .SetValidator(activityValidator);

This suggestion is to move this check from the validator to the handler and load all activities to verify the relation ID.

Related Issue(s)

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., if applicable)

@oskogstad oskogstad force-pushed the fix/allow-new-activities-to-reference-old-activities branch from 7aa440e to 50c9acd Compare July 27, 2024 21:44
@oskogstad oskogstad marked this pull request as ready for review July 27, 2024 21:46
@oskogstad oskogstad requested a review from a team as a code owner July 27, 2024 21:46
@oskogstad oskogstad changed the title fix: Allow ned activities to reference old activities fix: Allow new activities to reference old activities Jul 27, 2024
Copy link

@oskogstad oskogstad merged commit bbc443e into main Jul 29, 2024
17 checks passed
@oskogstad oskogstad deleted the fix/allow-new-activities-to-reference-old-activities branch July 29, 2024 08:14
arealmaas pushed a commit that referenced this pull request Jul 30, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.9.0](v1.8.1...v1.9.0)
(2024-07-30)


### Features

* **breaking:** Move front channel embeds to content
([#862](#862))
([c9b50e9](c9b50e9))
* **breaking:** Remove DialogElements, add Attachments
([#867](#867))
([dbe296a](dbe296a))
* **breaking:** Remove PUT/DELETE endpoints for DialogElements
([#844](#844))
([51eb898](51eb898))
* **breaking:** Rename CultureCode to LanguageCode
([#871](#871))
([96d50fc](96d50fc))
* **breaking:** Renaming dialog activity types
([#919](#919))
([af262b1](af262b1))
* Change content array to object with properties for each content type
([#905](#905))
([d549f19](d549f19))
* Implement actor entity
([#912](#912))
([a635fcb](a635fcb))
* Introduce Transmissions
([#932](#932))
([3ca495f](3ca495f))
* Rename DialogStatus enum values
([#915](#915))
([5aea32b](5aea32b))
* **WebAPI:** Add Transmission endpoints
([#943](#943))
([d608ade](d608ade))


### Bug Fixes

* Allow new activities to reference old activities
([#935](#935))
([bbc443e](bbc443e))
* **auth:** Malformed JWTs no longer results in InternalServerError
([#870](#870))
([5f2f386](5f2f386))
* **slackNotifier:** Add missing deployment of Slack notifier function
in staging environment
([#861](#861))
([59091f7](59091f7))
* Update e2e tests for actor model
([#918](#918))
([ec1fcb1](ec1fcb1))
* **WebAPI:** Allow purging of softly deleted dialogs
([#940](#940))
([c527c9f](c527c9f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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

Successfully merging this pull request may close these issues.

2 participants