Commit 50058d2
committed
fix(review): exclude deleted folders from sort order; make the allowlist tests real
Three findings from cubic on #7062, all valid.
1. nextWorkflowSortOrder consulted the folder minimum without excluding
soft-deleted folders. Because the helper returns min - 1, a deleted folder
holding the lowest slot ratchets the floor down permanently — the same class
of bug as the archived-workflow one this PR set out to fix, on the other half
of the query. lib/folders/orchestration.ts already documents this exact
rationale for the folder-creation side of the same algorithm, and the uploads
folder manager filters it too; this was the outlier.
2. The two new allowlist tests did not call setEnterpriseOrgWorkspace(), so
resolution never reached the group queries and validateBlockType returned
early. They passed against the unfixed code when run in isolation and only
appeared to fail in a full-file run, where mock state leaked from earlier
tests. Verified with 'vitest -t': both now fail without the case-folding fix
and pass with it.
3. The restore-resource comment this PR rewrote was itself wrong. A Partial map
does not defer the failure into the cascade — the lookup widens to
FolderResourceType | undefined and the error lands on the restoreFolder call
site. Reworded to say that, and why keeping the check at the mapping matters.1 parent 4befe38 commit 50058d2
3 files changed
Lines changed: 14 additions & 8 deletions
File tree
- apps/sim
- ee/access-control/utils
- lib
- resources/orchestration
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| 458 | + | |
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | | - | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments