charoalvarez commented on issue #2357:
URL: 
https://github.com/apache/incubator-kie-issues/issues/2357#issuecomment-4856706883

   # Follow-up: confirmed still present in 10.1.0 and `main`
   
   Thanks for the pointer — I re-tested against 10.1.0 and also checked the 
code directly in `main`. Summary below.
   
   ## 10.1.0
   
   Reproduced the exact same behavior as in 10.0.0: applying the Quarkus 
accelerator to a DMN file fails the same way (path duplication when the DMN is 
already under `src/main/resources/dmn/`, and/or `Moving not supported.` thrown 
from the Companion FS listener, leading to the `doesn't exist` / 404 error on 
Dev Deployment).
   
   ## `main` (checked at commit `4ec13261c5a0`, 2026-07-01)
   
   I cloned `main` and inspected the two relevant files directly. Both bugs are 
still present, with no code changes since the version originally reported:
   
   1. **Path duplication** — 
`packages/online-editor/src/accelerators/AcceleratorsHooks.tsx`, 
`applyAcceleratorToWorkspace`, still does:
   
      ```ts
      const movedFile = await workspaces.moveFile({
        file,
        newDirPath: join(fileNewDestination, dirname(file.relativePath)),
      });
      ```
   
      This still blindly concatenates `fileNewDestination` with 
`dirname(file.relativePath)`, which duplicates the path when the file is 
already inside the destination folder.
   
   2. **`WSSFS_MOVE` not handled** — 
`packages/online-editor/src/companionFs/CompanionFsHooks.ts`, still does:
   
      ```ts
      } else if (data.type === "WSSFS_MOVE") {
        throw new Error("Moving not supported.");
      }
      ```
   
      Unlike `WSSFS_RENAME` (which is handled by copying content to the new 
path and deleting the old entry), `WSSFS_MOVE` still just throws, uncaught, 
inside the `BroadcastChannel.onmessage` callback.
   
   For context: I also found two prior PRs that touched this same 
`AcceleratorsHooks.tsx` file — #2299 (kie-issues#408, wrong branch 
initialization) and #2309 (kie-issues#407, workspace breaking on accelerator 
init failure) — but neither touched the `moveFile`/`fileNewDestination` logic, 
so they don't overlap with this issue.
   
   ## Conclusion
   
   The bug is confirmed to still affect `main` as of today, so it makes sense 
to fix it there directly. The two suggested fixes from the original report 
still apply:
   
   - **Bug 1**: strip any prefix of `file.relativePath` that already matches 
`fileNewDestination` before joining, instead of concatenating unconditionally.
   - **Bug 2**: implement `WSSFS_MOVE` the same way `WSSFS_RENAME` is 
implemented (copy content to new path in Companion FS, then delete the old 
entry) instead of throwing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to