fix room sort#7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b82391cfe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Tracked sequence is driven from the DB, not the cache: newly created or | ||
| // not-yet-cached channels would otherwise be silently dropped, leaving them | ||
| // clumped at their creation-order positions. | ||
| const sortedTracked = [...rows].sort(desiredOrder); |
There was a problem hiding this comment.
Filter tracked rows to the event category before positioning
Building sortedTracked from all DB rows causes reorderRoomChannels to include channels that are tracked but no longer children of event.roomCategoryId (for example, if a room channel was manually moved to a different category). Those off-category channels are then passed into guild.channels.setPositions, which can reorder unrelated channels or fail with missing-permission errors in that other category; with this commit’s new throw, that failure aborts the rest of reconciliation (including reconcileRoleAssignments). The previous logic only reordered channels found under category.children, so this is a functional regression.
Useful? React with 👍 / 👎.
No description provided.