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

Fixes #23235: missing execution of an IOResult in parent ticket #4965

Conversation

fanf
Copy link
Member

@fanf fanf commented Aug 7, 2023

https://issues.rudder.io/issues/23235

the core problème was that :

                path <- sanitizePath(dest.replaceFirst("/", "") + '/' + file.fileName, basePath)
              } yield {
                for {
                  in  <- file.fileStream.autoClosed
                  out <- path.newOutputStream.autoClosed
                } yield {
                  in.pipeTo(out)
               }

is an IOResult and not a value, so the side effect that used to process the uploaded file was not executed anymore.

The PR also:

  • simplify the useless effectM (since we don't have to lift code here, we are already in the good world with sanitizePath)
  • add some check in the number of uploaded files. Before that, if several were uploaded, then the last (decided by some code in some lib) used to win. Now it's an error.

@fanf fanf requested a review from amousset August 7, 2023 20:16
@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/4965
-- Your faithful QA
Kant merge: "To be is to do."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/71999/console)

@amousset
Copy link
Member

amousset commented Aug 7, 2023

OK, merging this PR

@amousset amousset merged commit 56fa8b3 into Normation:branches/rudder/7.2 Aug 7, 2023
16 checks passed
@fanf fanf deleted the bug_23235/missing_execution_of_an_ioresult_in_parent_ticket branch March 15, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants