nanxiuzi commented on PR #18637:
URL:
https://github.com/apache/dolphinscheduler/pull/18637#issuecomment-5711341484
Good catch — you're right, and it's worse than just the sibling case. I
reproduced both failure modes:
```
dir=/resources/a+b
regex -> false (does not match its own child)
startsWith -> true
dir=/resources/a[bc
regex -> SyntaxError (throws)
startsWith -> true
```
So my `(/|$)` version only papered over the prefix-collision symptom while
leaving the unescaped-interpolation bug intact. Applied your suggestion
verbatim in 6096c60:
```ts
return (
res.dirctory &&
(fullName === res.fullName || fullName.startsWith(`${res.fullName}/`))
)
```
Verified all cases after the change:
| case | result |
|---|---|
| sibling prefix (`datax_to_doris` vs `datax_to_doris2`) | picks
`datax_to_doris2` |
| `a[bc` directory | `true` (no throw) |
| `a+b` directory | `true` |
| exact self match | `true` |
| non-ancestor | `false` |
`pnpm run lint` passes. Re-requesting review.
--
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]