Skip to content

fix(TaskProcessing): Normalize file ID before getting node#60218

Open
marcelklehr wants to merge 1 commit intomasterfrom
fix/tp-file-id
Open

fix(TaskProcessing): Normalize file ID before getting node#60218
marcelklehr wants to merge 1 commit intomasterfrom
fix/tp-file-id

Conversation

@marcelklehr
Copy link
Copy Markdown
Member

@marcelklehr marcelklehr commented May 7, 2026

Summary

getFirstNodeById will throw if it gets anything other than an int.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr added this to the Nextcloud 34 milestone May 7, 2026
@marcelklehr marcelklehr requested a review from a team as a code owner May 7, 2026 12:51
@marcelklehr marcelklehr requested review from ArtificialOwl and removed request for a team May 7, 2026 12:51
@marcelklehr marcelklehr added the 3. to review Waiting for reviews label May 7, 2026
@@ -1633,9 +1633,16 @@ private function validateOutputFileIds(array $output, ...$specs): array {
* @throws ValidationException
*/
private function validateFileId(mixed $id): File {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should only pass int to this function and fix the string wherever it is coming from 🙈

Copy link
Copy Markdown
Member Author

@marcelklehr marcelklehr May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reconsider how task processing works before jumping to conclusions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $id param value originally comes from the task input which can be invalid. We don't know what the API consumer will have set in there. This seems justified to validate this like that.

Or maybe you meant something different.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just suggesting that this kind of validation should probably happen much earlier.

Anyway I'm fine with this, it was only a suggestion and therefore I didn't request changes.

@marcelklehr
Copy link
Copy Markdown
Member Author

/backport to stable32

@marcelklehr
Copy link
Copy Markdown
Member Author

/backport to stable33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants