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

Prohibit creation of attachments without taskId and processInstanceId #4834

Open
1 task
PHWaechtler opened this issue Dec 4, 2024 · 0 comments
Open
1 task
Labels
scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI type:bug Issues that describe a user-facing bug in the project.

Comments

@PHWaechtler
Copy link
Contributor

PHWaechtler commented Dec 4, 2024

Environment (Required on creation)

Observed on current master, ie 7.23.0-SNAPSHOT.

TODO: clarify backports

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

See this discussion for more detail.

We document that upon creation of attachments, either taskId or processInstanceId has to be provided. However, this is not being validated in the BE- there we are currently just confirming the taskID and processInstanceId is not null. An empty string could still be used however.

Steps to reproduce (Required on creation)

Create an attachment where both the taskId is an empty string and the processInstanceId is also an empty string.

Observed Behavior (Required on creation)

Observe that no error is returned and an attachment is created.

Expected behavior (Required on creation)

It is not possible to create an attachment without both taskId and processInstanceId. We should return an error with a message that explains these requirements to the user.

Root Cause (Required on prioritization)

In the BE we are currently just confirming the taskID is not null. Since its an empty string this will pass, leading to task being null. We do check for the task being null but then again we just validate that processInstanceId is not null. Since processInstanceId is not null but an empty string, we continue with the creation.

Solution Ideas

Validate both against null and emtpy strings and enforce that at least one of the two parameters is neither null nor empty.

Hints

Code
Context

Links

This is related to #3545

Breakdown

Pull Requests

Preview Give feedback
No tasks being tracked yet.

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
@PHWaechtler PHWaechtler added the type:task Issues that are a change to the project that is neither a feature nor a bug fix. label Dec 4, 2024
@PHWaechtler PHWaechtler added type:bug Issues that describe a user-facing bug in the project. and removed type:task Issues that are a change to the project that is neither a feature nor a bug fix. labels Dec 5, 2024
@tasso94 tasso94 added the scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI label Dec 5, 2024
@PHWaechtler PHWaechtler removed their assignment Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI type:bug Issues that describe a user-facing bug in the project.
Projects
None yet
Development

No branches or pull requests

2 participants