Server admin 4: fluxer-api community, roles and the sudo header (#670) #719
Closed
charles
wants to merge 0 commits from
serveradmin-4-api-community-roles-sudo into serveradmin
pull from: serveradmin-4-api-community-roles-sudo
merge into: charles:serveradmin
charles:main
charles:camera
charles:dailyuse
charles:textchat
charles:fix-1008-idle-in-voice
charles:camera-21-acceptance
charles:feat-1000-app-sounds-output
charles:fix-1001-local-time
charles:camera-20-parity-list-for-the
charles:fix-931-silent-voices
charles:camera-15-ui-settings-voice-video
charles:camera-14-ui-camera-buttons-camera
charles:camera-16-ui-layout-with-cameras
charles:camera-17-core-toggle-camera-shortcut
charles:camera-13-ui-mirrored-video-and
charles:camera-12-appsfluxer-camera-runtime-and
charles:camera-10-capture-camera-on-linux
charles:camera-11-capture-camera-on-windows
charles:camera-9-voice-the-camera-track
charles:camera-7-core-the-own-camera
charles:camera-6-capture-camera-trait-mode
charles:camera-8-core-remote-cameras-tile
charles:camera-3-spike-a-camera-track
charles:camera-4-video-camera-formats-and
charles:camera-18-devserver-camera-scenario
charles:camera-1-spike-capture-linux
charles:camera-5-core-camera-ports-commands
charles:camera-2-spike-capture-windows
charles:camera-plan
charles:shell
charles:fix-925-keybinds-persist
charles:feat-934-935-stream-view
charles:feat-933-stream-output-device
charles:shell-44-acceptance
charles:feat-946-select-message-text
charles:shell-43-parity-list-for-the
charles:fix-589-black-band-linux-sender
charles:shell-37-ui-system-wide-shortcuts
charles:shell-ship
charles:fix-931-voices-silent-after-long-uptime
charles:shell-39-ui-settings-notifications
charles:shell-36-ui-settings-keybinds
charles:shell-16-core-autostart
charles:fix-923-late-publication-next-share
charles:fix-921-share-teardown-publish-race
charles:shell-1-spike-iced-daemon-hide
charles:shell-10-core-instance-messages-tasks
charles:shell-11-core-keybinds-actions-combos
charles:shell-13-core-badge-attention-sound
charles:shell-14-core-notification-settings-inactive
charles:shell-18-platform-desktop-entry-and
charles:shell-2-spike-tray-on-linux
charles:shell-3-spike-wayland-global-shortcuts
charles:shell-41-devserver-shell-scenario
charles:shell-5-spike-overlay-technique-for
charles:shell-6-core-shell-ports-settings
charles:shell-7-platform-settings-shell-keybinds
charles:shell-8-core-tray-model-and
charles:shell-9-core-window-rules-close
charles:fix-913-keep-awake-retry
charles:shell-35-ui-in-window-voice
charles:shell-sync-textchat
charles:shell-34-app-shortcuts-runtime
charles:fix-913-keep-screen-awake
charles:fix-910-deepfilter-windows-timing
charles:shell-33-app-shell-runtime
charles:shell-28-platform-shortcuts-on-wayland
charles:fix-910-deepfilter-late-frame
charles:shell-29-platform-shortcuts-by-direct
charles:shell-27-platform-shortcuts-on-x11
charles:shell-17-platform-single-instance
charles:shell-24-platform-badge-displays-and-24
charles:shell-26-platform-shortcuts-on-windows
charles:shell-21-platform-tray-on-linux
charles:shell-22-platform-tray-on-windows
charles:fix-908-flaky-stream-end-test
charles:shell-30-platform-wayland-activation
charles:shell-38-ui-settings-desktop
charles:shell-19-platform-autostart
charles:shell-25-platform-shortcut-back-end
charles:shell-23-platform-badge-displays-and
charles:shell-40-ui-companion-apps-control
charles:shell-31-statusapi-default-avatars
charles:shell-12-core-system-wide-shortcut
charles:shell-20-platform-tray-trait-icons
charles:shell-32-ui-daemon-window-lifecycle
charles:shell-4-spike-raising-a-wayland
charles:shell-15-core-status-payload-gaps
charles:fix-876-share-resolution-and-bars
charles:shell-42-packaging-windows-shortcuts-and
charles:fix-874-tests-must-not-notify
charles:fix-868-deepfilternet-start
charles:gamenight-plan
charles:fix-867-869-stream-end-soundboard-limits
charles:feat-229-windows-hardware-encoding
charles:fix-857-vaapi-hardware-encoding
charles:fix-849-inert-cards
charles:fix-848-pinned-messages-clickable
charles:shell-plan
charles:fix-764-nvenc-above-720p30
charles:serveradmin
charles:feat-780-forum-archived-filter
charles:serveradmin-35-acceptance
charles:feat-781-no-join-chime-with-entrance-sound
charles:feat-784-rejoin-voice-after-update
charles:fix-779-782-search-dropdown-paste-preview
charles:fix-783-781-dm-rail-entrance-sound
charles:serveradmin-34-parity-screenshots
charles:serveradmin-31-ui-channel-permissions
charles:fix-773-cargo-deny-advisories
charles:serveradmin-33-ui-sudo-delete-transfer
charles:serveradmin-28-ui-members-page
charles:serveradmin-26-ui-role-permissions
charles:serveradmin-30-ui-voice-overview-channel-invites
charles:serveradmin-fix-27-29
charles:serveradmin-25-ui-roles-tab
charles:serveradmin-27-ui-menus-moderation-modals
charles:serveradmin-29-ui-channel-settings
charles:fix-589-stream-top-strip-encode
charles:serveradmin-24-ui-moderation-invites-bans
charles:feat-760-version-in-title
charles:fix-751-stream-audio-pipewire
charles:serveradmin-20-core-menu-rows
charles:fix-752-linux-notification-panic
charles:serveradmin-17-core-overrides
charles:fix-740-updater-always-latest
charles:serveradmin-23-ui-community-settings-overview
charles:serveradmin-12-core-roles
charles:serveradmin-19-core-sudo-delete-transfer
charles:serveradmin-32-ui-sidebar-drag
charles:serveradmin-15-core-members-page
charles:serveradmin-16-core-channel-settings
charles:serveradmin-14-core-bans-invites
charles:fix-615-restore-on-stored-session-start
charles:serveradmin-22-runtime
charles:serveradmin-13-core-member-moderation
charles:serveradmin-18-core-channel-reorder
charles:fix-732-status-api-speaking
charles:serveradmin-10-core-permission-lists
charles:serveradmin-11-core-forms-community
charles:serveradmin-21b-devserver-channels-members-sudo
charles:serveradmin-9b-core-hierarchy-bulk-events
charles:serveradmin-21a-devserver-community-roles
charles:serveradmin-9a-core-ports
charles:serveradmin-8-form-widgets
charles:serveradmin-5-api-channels-members-bans
charles:serveradmin-7-settings-shell
charles:serveradmin-1-proto-community-roles
charles:serveradmin-3-proto-members-bans-invites
charles:serveradmin-6-reorder-widget
charles:serveradmin-2-proto-channel-admin
charles:fix-706-presence-after-reconnect
charles:fix-615-start-on-last-view
charles:feat-663-create-channel
charles:serveradmin-plan
charles:fix-662-long-text-wrap
charles:fix-660-661-menu-toolbar-paste-focus
charles:fix-620-forum-list-reactions
charles:fix-657-windows-console
charles:fix-622-emoji-in-names
charles:fix-smoke-645-648
charles:fix-614-install-location
charles:dailyuse-41-acceptance
charles:fix/597-copy-id
charles:dailyuse-40-parity-screenshots
charles:dailyuse-35-ui-quick-switcher-keybinds
charles:dailyuse-38-ui-profile-modal
charles:fix/voice-view
charles:fix/side-panel-composer
charles:dailyuse-37b-ui-composer-barriers-blocked
charles:fix/image-viewer
charles:fix/619-picker-flicker
charles:fix/editor-forum-edit
charles:dailyuse-32-ui-status-picker
charles:dailyuse-34b-ui-add-guild-invite-modal
charles:dailyuse-28-app-dailyuse-runtime
charles:dailyuse-36-ui-voice-badge-refusals
charles:fix/594-menu-placement-textchat
charles:fix/589-stream-top-strip
charles:fix/594-menu-placement
charles:dailyuse-39-ui-report-modal
charles:dailyuse-37a-ui-attachment-audio-group-icon
charles:dailyuse-24-core-notification-icon-passive
charles:fix/587-quiet-voice
charles:dailyuse-30-ui-notification-settings-modal
charles:dailyuse-31-ui-user-dm-menus
charles:dailyuse-22b-core-composer-barriers-blocked
charles:dailyuse-22a-core-mark-unread-attachments
charles:dailyuse-29-ui-channel-guild-menus
charles:dailyuse-18-core-user-dm-menus
charles:dailyuse-33-ui-confirm-friends-page
charles:dailyuse-22c-core-trusted-domains-hide-muted
charles:dailyuse-20-core-keyboard-navigation
charles:dailyuse-15-core-friends-blocking
charles:dailyuse-23-core-profile-report-flow
charles:dailyuse-19-core-quick-switcher
charles:dailyuse-14-core-status-idle-presence
charles:dailyuse-17-core-channel-guild-menus
charles:ci/27-linux-cache
charles:dailyuse-37c-ui-trust-links-hide-muted
charles:dailyuse-13-core-honour-mutes
charles:dailyuse-34a-ui-invite-cards-accept
charles:dailyuse-16b-core-create-invites-guilds
charles:dailyuse-12-core-notification-settings-mutes
charles:dailyuse-16a-core-invite-links
charles:dailyuse-25-audio-attachments
charles:dailyuse-21-core-voice-refusals
charles:dailyuse-11b-core-state-skeleton
charles:dailyuse-11a-core-dailyuse-ports
charles:dailyuse-26b-devserver-dailyuse-b
charles:dailyuse-26a-devserver-dailyuse-a
charles:dailyuse-4-api-settings-acks-reports
charles:dailyuse-5-api-relationships-invites-guilds
charles:dailyuse-27-platform-notification-idle
charles:dailyuse-10-highlight-languages
charles:fix-search-focus-hover-emoji
charles:dailyuse-8-context-menu-widget
charles:dailyuse-9-image-load-retry
charles:dailyuse-7-chat-navigation-persistence
charles:dailyuse-2-proto-relationships-invites-reports
charles:dailyuse-1-proto-notification-presence
charles:dailyuse-6-gateway-op12-presence
charles:textchat-next
charles:fix-stream-black
charles:fix-reactions-hover
charles:textchat-68-app-video-playback-runtime
charles:textchat-35-acceptance
charles:textchat-34-parity-screenshots
charles:textchat-74-app-updater-runtime
charles:textchat-67-ui-video-player
charles:textchat-stage-46-47
charles:textchat-47-ui-media-channel
charles:textchat-75-promote-stable-workflow
charles:textchat-46-ui-forum-composer
charles:textchat-73-ui-update-button
charles:textchat-64-media-playback-crate
charles:textchat-stage-43-48
charles:textchat-72-platform-updater
charles:textchat-44-ui-thread-view
charles:textchat-70-release-update-feed
charles:textchat-48-ui-announcements
charles:textchat-45-ui-forum-view
charles:textchat-71-core-updater
charles:textchat-43-ui-sidebar-links-notes
charles:textchat-stage-40
charles:textchat-42-app-channel-types-runtime
charles:textchat-39-core-forums
charles:textchat-40-core-announcements-thread-admin
charles:textchat-60-ui-entrance-sounds
charles:textchat-63-ffmpeg-lgpl-packaging
charles:textchat-stage-batch6
charles:textchat-69-proto-update-manifest
charles:textchat-61-app-soundboard-entrance-runtime
charles:textchat-52-app-audio-devices-runtime
charles:textchat-38-core-channel-routing
charles:soundboard-effect-emoji
charles:status-api-rebind
charles:textchat-28-ui-gif-picker
charles:textchat-41-devserver-channel-types
charles:voice-panel-soundboard
charles:textchat-29-ui-message-actions
charles:textchat-37-api-channel-types
charles:textchat-66-core-video-players
charles:autoupdate-plan
charles:textchat-33-ui-message-list-settings
charles:textchat-32-ui-dms
charles:textchat-62-rename-flaxative
charles:fix-chatcolumn-tree
charles:textchat-65-audio-media-source
charles:textchat-31-ui-threads
charles:textchat-stage-27
charles:textchat-30-ui-search-pins-inbox
charles:textchat-53-ui-audio-sources-menu
charles:textchat-27-ui-expression-picker
charles:textchat-57-core-entrance-library
charles:textchat-36-proto-channel-types
charles:textchat-26-ui-upload-tray
charles:textchat-59-ui-soundboard-popout-parity
charles:textchat-58-audio-sound-edit
charles:textchat-55-proto-api-entrance-library
charles:textchat-25-ui-composer
charles:textchat-56-core-soundboard-parity
charles:rename-video-plan
charles:textchat-stage-25
charles:textchat-stage-23-24
charles:soundboard-plan
charles:textchat-24-ui-message-row
charles:textchat-22-ui-attachments-media
charles:textchat-23-ui-embeds
charles:textchat-14-core-expressions
charles:textchat-21-app-textchat-runtime
charles:textchat-16-core-navigation-read
charles:textchat-17-core-search
charles:textchat-19-core-dms-settings
charles:textchat-stage-13-15-18
charles:textchat-54-livekit-stereo-audio
charles:textchat-50-core-stream-audio-sources
charles:textchat-12-core-uploads
charles:textchat-15-core-message-actions
charles:textchat-11-core-composer
charles:textchat-18-core-threads
charles:textchat-13-core-reactions
charles:textchat-51-audio-pipewire-devices
charles:textchat-49-capture-audio-targets
charles:audio-plan
charles:textchat-plan2
charles:textchat-20-devserver-textchat
charles:textchat-6-api-chat-endpoints
charles:textchat-10-core-chat-ports
charles:textchat-9-ui-code-highlighting
charles:textchat-3-proto-expressions-threads-prefs
charles:textchat-5-api-messages-uploads
charles:textchat-2-proto-chat-requests-events
charles:textchat-8-ui-inline-flow-emoji
charles:screenshare
charles:textchat-7-platform-files-clipboard
charles:textchat-1-proto-message-content
charles:textchat-4-emoji-crate
charles:screenshare-31-acceptance
charles:screenshare-29-parity-screenshots
charles:textchat-plan
charles:screenshare-24-ui-focus-layout
charles:screenshare-27-ui-stream-menu
charles:screenshare-30-packaging-ci
charles:screenshare-21-app-screenshare-runtime
charles:screenshare-22-ui-sidebar-live
charles:screenshare-23-ui-stream-tile
charles:screenshare-26-ui-source-picker
charles:screenshare-28-ui-screenshare-settings
charles:screenshare-13-core-previews
charles:screenshare-12-core-codec-negotiation
charles:screenshare-25-ui-share-controls
charles:screenshare-18-hw-encode-linux
charles:screenshare-19-spike-hw-encode-windows
charles:screenshare-11-core-stream-params
charles:screenshare-20-devserver-screenshare
charles:screenshare-10-core-go-live
charles:screenshare-17-voice-livekit-video
charles:screenshare-14-audio-capture-linux
charles:wip/screenshare-17
charles:screenshare-integration
charles:feat-user-profile
charles:fix-voice-join
charles:feat-entity-images
charles:screenshare-16-voice-video-session
charles:screenshare-9-core-watching
charles:screenshare-5-capture-windows
charles:fix-wire-livekit
charles:screenshare-4-capture-linux
charles:screenshare-15-audio-capture-windows
charles:fix-member-list
charles:screenshare-8-core-stream-ports
charles:fix-live-protocol
charles:screenshare-6-ui-video-widget
charles:screenshare-3-capture-crate
charles:fix-altcha-captcha
charles:screenshare-1-video-frames
charles:screenshare-7-proto-api-streams
charles:screenshare-2-spike-livekit-video
charles:voice
charles:voice-26-acceptance
charles:voice-23-voice-e2ee
charles:voice-25-packaging-ci
charles:voice-13-voice-livekit-interop
charles:voice-24-parity-screenshots
charles:voice-19-ui-soundboard
charles:voice-20-ui-participant-menu
charles:voice-22-ui-dm-calls
charles:voice-21-ui-voice-settings
charles:voice-18-ui-call-view
charles:voice-14-app-voice-runtime
charles:voice-10-core-soundboard
charles:voice-17-ui-voice-panel
charles:voice-9-core-voice-settings-advert
charles:voice-5-audio-clips-chimes
charles:voice-15-devserver-voice
charles:voice-8-core-live-room-volumes
charles:voice-11-core-calls-status
charles:voice-12-voice-session
charles:voice-4-audio-devices-mixer
charles:voice-16-ui-voice-sidebar
charles:voice-7-core-voice-connection
charles:foundation
charles:voice-2-proto-api-soundboard-rtc
charles:voice-6-core-voice-states
charles:voice-3-audio-dsp
charles:voice-1-proto-voice-gateway
charles:task/26-acceptance
charles:task/25-packaging-release
charles:task/24-screenshot-tests
charles:task/20-ui-message-list-composer
charles:task/22-ui-settings-parity
charles:task/18-ui-main-layout
charles:task/23-notifications
charles:task/17-ui-shell-login
charles:task/14-app-runtime
charles:ci/51-windows-disk-space
charles:task/12-platform-persistence
charles:task/13-devserver
charles:task/21-ui-avatar-image-cache
charles:task/10-core-messages-readstate
charles:task/9-core-guilds-channels
charles:task/7-gateway-machine-transport
charles:task/11-core-presence-ui
charles:task/19-ui-rich-text
charles:task/8-core-store-session
charles:task/16-ui-theme-fonts-icons
charles:task/15-status-api
charles:task/4-proto-gateway-events
charles:task/5-openapi-vendor-contract
charles:task/6-api-client
charles:task/3-proto-rest-models
charles:task/2-proto-primitives
charles:task/1-workspace-scaffold
No reviewers
Labels
Clear labels
bug
A bug found while working on something else; steps to reproduce and the commit seen on
ci
Build, CI runners and workflows
follow-up
Deferred reviewer finding, linked from the PR it came from
good-first-task
Small, well-scoped, no cross-crate knowledge needed
parity
Settings/behaviour parity with the Electron client
question
Design question that needs Charles; blocks its task until answered
ready-to-merge
Reviewer approved, foundation merged in, CI green on both runners; waiting for the orchestrator to merge
task
A plan task (one per Foundation plan task)
No labels
bug
ci
follow-up
good-first-task
parity
question
ready-to-merge
task
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
charles/fluxer-native!719
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "serveradmin-4-api-community-roles-sudo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this builds
fluxer-api(guilds.rs):update_guild(PATCH /guilds/{id}),delete_guild(POST /guilds/{id}/delete, 204),transfer_ownership(POST /guilds/{id}/transfer-ownership). These are the three sudo-capable methods. Each one returnsSudo<T> { value, token: Option<SudoToken> }.roles.rs(new):create_role,update_role,delete_role(204),update_role_positions(PATCH /guilds/{id}/roles, 204).client.rs, the sudo header:SUDO_MODE_HEADER = "X-Fluxer-Sudo-Mode-JWT"(fromSudoModeMiddleware.ts), an opaqueSudoToken(no accessor;DebugprintsSudoToken(…);PartialEqfor tests), andApiClient::with_sudo_token(token). The token is sent only on the three sudo-capable requests, throughsudo_request, as a sensitive header value. The token is read from a successful answer only.ApiClient'sDebugredacts it, and observers never see headers.error.rs:ApiError::code(),is_sudo_required()(403SUDO_MODE_REQUIRED, asisSudoRequiredFailure) andis_sudo_verification_failure(). For the last one,classifytakes a 400INVALID_FORM_BODYwhoseerrors[]entry has a path inSUDO_VERIFICATION_FIELDSand returns that entry's code and message (INVALID_PASSWORD,INVALID_MFA_CODE,PASSWORD_NOT_SET; exported asSUDO_VERIFICATION_CODES). This works the same way as the existing entrance-sound codes.fixtures/errors/resource_locked.json, shaped likeapi/channel/utils/RetryingLock.ts:24-29(a 429 ThrottledError withretry_after: 1).Tests
Wiremock tests in
crates/fluxer-api/tests/{guild_admin,roles,sudo}.rs:reorder_succeeds_after_one_resource_locked;wrong_password_is_a_verification_failure.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cipasses locally. No display tests are involved.Deviations and points to review
error.rsis not in the task's Files list. I changed it because a typed sudo verification failure needs the error's field. I did not add anApiErrorvariant or field, soapps/fluxer's exhaustive matches are untouched. Task 5 (#671) also editsclassify, in a different hunk; the merge should be trivial. Task 19's core can tell a wrong answer apart by the 400 plus a code fromSUDO_VERIFICATION_CODES.PASSWORD_NOT_SETis not influxer_proto::errors::validationyet, so it is a local constant influxer-api.update_role_positionsusesRetry::Once, the only write that does. Positions are absolute, the server'sRESOURCE_LOCKEDis a 429 with a 1 s wait, and the original retries any 429. A lock that is still held after the retry surfaces asApiError::RateLimited. MISSING_PERMISSIONS staysHttp { 403, code }.create_roleandupdate_rolereturn theRolethe server answers with (GuildRoleResponse).--recordis Task 22's work, as planned.Closes #670
🤖 Generated with Claude Code
https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Wiremock tests for update_guild, delete_guild, transfer_ownership, the role CRUD and positions, the sudo header sent and read, and the typed refusals. fixtures/errors/resource_locked.json is shaped like the server's lock refusal: fluxer_api/src/api/channel/utils/RetryingLock.ts:24-29 (ThrottledError, 429, Retry-After 1, data {retry_after: 1}), serialised by packages/errors/src/FluxerError.ts:50-56; the message is packages/errors/src/i18n/ErrorI18nMessages.ts:114. Refs #670 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4KIndependent review: Task 4 (api-community-roles-sudo)
Scope:
git diff 28edd5a8..origin/serveradmin-4-api-community-roles-sudo(1e82ab07), read without relying on the implementer's notes.What checks out
update_guild_patch_body_and_answer,delete_guild_is_post_delete,transfer_ownership_body,role_crud_paths_and_bodies,role_positions_204,sudo_required_maps_to_typed_error,sudo_header_sent_when_token_set_and_only_on_sudo_methods,sudo_token_read_from_answer,token_and_password_absent_from_debug_and_errors,missing_permissions_and_resource_locked_typed). There are also two extra tests:wrong_password_is_a_verification_failureandreorder_succeeds_after_one_resource_locked.update_guild/delete_guild/transfer_ownershipreturnSudo<Guild>/Sudo<()>/Sudo<Guild>.create_role,update_role,delete_roleandupdate_role_positions(guild, &[RolePosition])(PATCH, 204) exist.SudoTokenis opaque and itsDebugprintsSudoToken(…).ApiClient::with_sudo_token,SUDO_MODE_HEADERandSudo { value, token }are exported. The header goes only on the three sudo-capable methods, as the plan specifies, and the test asserts this.X-Fluxer-Sudo-Mode-JWT, which matches the server tests andRestTransport.tsSUDO_HEADER.PATCH /guilds/:id,POST /guilds/:id/delete(204) andPOST /guilds/:id/transfer-ownership(the guild) matchGuildBaseController.ts:211-277andGuildMemberController.ts:194-224. Role routes matchGuildRoleController.ts.INVALID_PASSWORD,INVALID_MFA_CODEandPASSWORD_NOT_SETonpassword/mfa_codematchSudoVerificationService.ts:95,109,116.isSudoRequiredFailureis a 403 withSUDO_MODE_REQUIRED. It matches.DebugofApiClientand ofSudoToken.HeaderValue::set_sensitiveis set on it.--recordredaction). That is acceptable.classifydoes not affect it.AuthError::from_login_failuremaps any 400.Findings
[blocking]
fixtures/errors/resource_locked.jsonand the reorder tests model the wrong server path.api/guild/services/GuildRoleService.tsfor the role reorder. ItsupdateRolePositions(lines 450-453) throwsResourceLockedErrorwhen the lock is held.ResourceLockedError(packages/errors/src/domains/core/ResourceLockedError.ts) extendsLockedError, which is HTTP 423 (statusError(423, false)). Its body iscode: "GENERAL_ERROR"("Something went wrong. Please try again later.") and its header isRetry-After: 2.RESOURCE_LOCKEDwithRetry-After: 1instead. That shape comes fromchannel/utils/RetryingLock.ts, which only the channel forum-tag, message-write and follow locks use. The role routes never use it.RETRYABLE_STATUSES, andretries: 5applies only to 429 and gateway errors. So against the real server, the code's runtime behaviour (no retry,Http { status: 423, code: GENERAL_ERROR }) is already right.ResourceLockedError(423,GENERAL_ERROR,Retry-After: 2; commit naming that file).missing_permissions_and_resource_locked_typedassert that the lock surfaces asHttp { status: 423, .. }and is sent once.RESOURCE_LOCKED" wording in §3.4/§9 with the orchestrator as a spec correction.[minor]
is_sudo_verification_failure()is narrower than the original'sisSudoVerificationFailure.INVALID_FORM_BODYwhoseerrors[]names any of the fiveSUDO_VERIFICATION_FIELDS(RestTransport.ts:368-384), whatever the entry's code.SUDO_VERIFICATION_CODES. A validator error onpassword/mfa_code/mfa_method(for example a length violation from the zod schema), or an entry without a code, would fail the action instead of asking again.SUDO_VERIFICATION_FIELDS), asfluxer_proto::errors::ApiErrorBody::is_sudo_verification_failurealready does, and keep the lifted code and message for display.[minor] The reorder retries a 429 once, where the original's
requestRoleOrderpassesretries: 5(GuildCommands.ts:116-119).Retry::Onceis the crate's existing convention, so this is noted only as a documented divergence.[minor] Out of the task's file list:
error.rschanges (theclassifylift,code(),is_sudo_*). The change is small and well contained, and the PR says so. The merge with Task 5's separateclassifyhunk needs a look.Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin the review worktree: green (all steps passed, exit 0).Verdict: changes requested. One blocking finding (1): the fixture and the lock tests must match
ResourceLockedError(423) from the citedGuildRoleService.ts.🤖 Generated with Claude Code
Independent review: Server admin 4 (fluxer-api community, roles, sudo header)
Reviewed
28edd5a8..1e82ab07(the pushed head ofserveradmin-4-api-community-roles-sudo). Local gateFLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: green (exit 0).Findings
fixtures/errors/resource_locked.json({"code":"RESOURCE_LOCKED", …, "retry_after":1}, served as a 429) is invented. The role reorder lock isGuildRoleService.ts:450-453throw new ResourceLockedError(). That isResourceLockedError.ts→LockedError(423), withcode: GENERAL_ERRORandRetry-After: 2. TheRESOURCE_LOCKED429 withretry_after: 1comes fromapi/channel/utils/RetryingLock.ts, which only the channel forum tags, follows and message writes use, not roles. The tests intests/roles.rs(missing_permissions_and_resource_locked_typed,reorder_succeeds_after_one_resource_locked), theupdate_role_positionsdoc comment and the README bullet all describe this wrong behaviour. The library code itself is fine:Retry::Onceretries only 429, so a real 423 surfaces asHttp{423, GENERAL_ERROR}and is not resent, which matches the original (RestTransport.tsreactToOutcomeretries only 429 andRETRYABLE_STATUSES). The implementer has a fix in thesa-4worktree, but it is uncommitted and not pushed. Commit it and push it, namingResourceLockedError.ts/GuildRoleService.tsin the commit message.GENERAL_ERROR, not a 429RESOURCE_LOCKED.is_sudo_verification_failuredecides by the lifted code (INVALID_PASSWORD,INVALID_MFA_CODE,PASSWORD_NOT_SET). The original'sisSudoVerificationFailuredecides by the error's path (password/mfa_code/…). These are the same for every errorSudoVerificationService.tsthrows today, but a schema-level 400 onmfa_code(say a bad length) would not be classified as a verification failure. Already tracked as #724.update_role_positionsusesRetry::Onceon 429. The original's transport retries 429 up to its rate-limit budget. This divergence is harmless, but it should be listed in the doc comment and README (the uncommitted fix does this).password/mfa_code. The README says so, and redacting them in--recordbelongs to Task 22 (Review Focus 6).error.rsis outside the task's Files list (the classify hunk), so expect a merge touch-point with Task 5.Checked and OK
wrong_password_is_a_verification_failureis extra) and assert the plan's points: the PATCH carries only the set fields,POST /guilds/{id}/deletegets{}and 204, the transfer body is flattened with TOTP, the role paths and bodies are right, reorder gets 204,SUDO_MODE_REQUIREDis typed, the header goes only on the three sudo methods (a role write gets none), the token is read from the answer (orNone), and no secret appears in Debug, Display or observer output.update_guild,delete_guild,transfer_ownership(returningSudo<T>),create_role,update_role,delete_role,update_role_positions(guild, &[RolePosition]),SudoToken(opaque,DebugprintsSudoToken(…)),Sudo { value, token },ApiClient::with_sudo_token,SUDO_MODE_HEADERall exist.SudoModeMiddleware.ts:7X-Fluxer-Sudo-Mode-JWT. Delete is 204 (GuildBaseController.ts:250-277). Transfer returnsGuildResponse(GuildMemberController.ts:194-224). Role positions get 204 (GuildRoleController.ts:165-195). The verification codes and paths matchSudoVerificationService.ts:95-116.ApiClientDebug redacts the token.Verdict: changes requested (1 blocking: commit and push the 423 GENERAL_ERROR fixture/test fix; the rest are minor).
Independent review (third pass): Server admin 4 (fluxer-api community, roles, sudo header)
Reviewed
28edd5a8..1e82ab07, the pushed head ofserveradmin-4-api-community-roles-sudo. That head has not changed since the two earlier reviews. The implementer's fixes are still uncommitted in thesa-4worktree, so this review covers the pushed code only. Local gateFLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: green (exit 0, all steps passed).Findings
fixtures/errors/resource_locked.jsonis still{"code":"RESOURCE_LOCKED", …, "retry_after":1}, served as a 429 intests/roles.rs.GuildRoleService.tsupdateRolePositionsthrowsResourceLockedErrorwhenacquireLockfails.packages/errors/src/domains/core/ResourceLockedError.tsextendsLockedError, which isstatusError(423, false).APIErrorCodes.GENERAL_ERRORand its header isRetry-After: 2.missing_permissions_and_resource_locked_typedandreorder_succeeds_after_one_resource_locked;update_role_positionsdoc comment, which citesRetryingLock.ts;Retry::Onceretries only on 429, so a real 423 surfaces asHttp{423}and is not sent again.sa-4working-tree fix (423GENERAL_ERRORfixture, corrected tests, doc comment and README).Retry::Onceon the reorder differs from the original, whose transport retries 429 within its rate-limit budget. The divergence is harmless, but it should be documented. The pending fix documents it.is_sudo_verification_failuredecides by the lifted code. The original decides by the field path (isSudoVerificationFailure). Already tracked as #724.RestTransport.ts:608sends the sudo header on every same-origin request. This client sends it only on the three sudo-capable methods, as the plan's Interfaces require. Not a defect.Checked and OK
tests/guild_admin.rs,tests/roles.rsandtests/sudo.rs.update_guild -> Sudo<Guild>,delete_guild -> Sudo<()>,transfer_ownership -> Sudo<Guild>;create_role,update_role,delete_role, andupdate_role_positions(guild, &[RolePosition])(PATCH, 204);SudoToken, which is opaque, printsSudoToken(…)inDebugand hasset_sensitiveon its header;Sudo { value, token },ApiClient::with_sudo_tokenandSUDO_MODE_HEADER.x-fluxer-sudo-mode-jwtmatchesRestTransport.ts:48, and the answer token is read the same way (:734).LockedError.ts, as described in finding 1.ApiClientDebug, and errors carry no password or token, which a test asserts.Verdict: changes requested. One blocking finding (1) remains on the pushed branch. CI is green locally.
The role reorder's lock is GuildRoleService.ts:450-453 updateRolePositions -> ResourceLockedError (packages/errors/src/domains/core/ResourceLockedError.ts) -> LockedError: HTTP 423, code GENERAL_ERROR, Retry-After: 2. The 429 RESOURCE_LOCKED of channel/utils/RetryingLock.ts is not used by any role route. - fixtures/errors/resource_locked.json: the server's 423 body. - tests/roles.rs: the lock surfaces as Http { 423, GENERAL_ERROR } sent once; the 429 retry is tested with a rate-limit body (once succeeds, twice is RateLimited). - update_role_positions doc comment and README: the 423, and the one-retry divergence from the original's retries: 5. - spec §3.4, §5, §9 and plan Tasks 12 and 21b: the same correction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Review fixes: role-order lock and spec/plan wording
Pushed
0befc9f3:2d8527ef(the fix), a merge oforigin/serveradmin(one README conflict, mechanical: both sides' entries kept), and0befc9f3(plan test name, see below).Finding 1 [blocking]: the lock fixture and tests had the wrong shape. Fixed. I checked this against
fluxer-soundboard:api/guild/services/GuildRoleService.ts:450-453: whenacquireLockfails,updateRolePositionsthrowsResourceLockedError.packages/errors/src/domains/core/ResourceLockedError.ts:LockedError(statusError(423, false)), codeGENERAL_ERROR, headerRetry-After: 2.ErrorI18nMessages.ts:93).Changes:
fixtures/errors/resource_locked.jsonis now that body:{"code":"GENERAL_ERROR","message":"Something went wrong. Please try again later."}.tests/roles.rs:missing_permissions_and_resource_locked_typedserves a 423 withRetry-After: 2and assertsApiError::Http { status: 423, code: Some("GENERAL_ERROR"), message: … }. It asserts exactly one PATCH (no retry).RATE_LIMITEDbody:reorder_succeeds_after_one_rate_limit(renamed fromreorder_succeeds_after_one_resource_locked) and a newreorder_rate_limited_twice_surfaces_rate_limited.RetryingLock.ts.Retry::Onceonly retries a 429, so the real 423 already surfaced untouched.Finding 2 (spec/plan wording). Corrected in this PR, because Tasks 12 and 21a/21b read it:
ResourceLockedError(GuildRoleService.ts:450-453): HTTP 423, codeGENERAL_ERROR,Retry-After: 2, which the original does not send again (RESOURCE_LOCKED, the 429 ofRetryingLock.ts, is a different lock the reorder does not use)."RESOURCE_LOCKEDbut the 423GENERAL_ERRORof §3.4."RESOURCE_LOCKEDstays in the list because it is a real server code.GENERAL_ERROR(Retry-After: 2, §3.4) once on a flagged reorder."GENERAL_ERROR,Retry-After: 2, spec §3.4; notRESOURCE_LOCKED) is not sent again: it fails like any other refusal, as in the original".resource_locked_retries_onceis nowlocked_reorder_is_not_sent_again.GENERAL_ERRORwithRetry-After: 2(spec §3.4; notRESOURCE_LOCKED) once when[serveradmin] lock_next_reorder = true". Its devserver already answers exactly that, and its test keeps its merged nameresource_locked_once("(the 423 above)" added in the plan).RESOURCE_LOCKED, so it is unchanged.Finding 3/4 (one 429 retry vs the original's
retries: 5). Now documented as a divergence in theupdate_role_positionsdoc comment and the README bullet. Behaviour is unchanged.is_sudo_verification_failuredecides by code, not path. Not changed here; it is tracked as #724.error.rsmerge with Task 5. The twoclassifyhunks merged cleanly: the moderation-code lift comes first, then the sudo-field lift, then the field-message join.Gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask cion the merged head: green,==> xtask ci: all steps passed, exit 0. The roles testsmissing_permissions_and_resource_locked_typed,reorder_succeeds_after_one_rate_limitandreorder_rate_limited_twice_surfaces_rate_limitedpass. The last commit only touches the plan.🤖 Generated with Claude Code
Orchestrator: the one blocking finding of review rounds 1–3 (role-reorder lock modelled as 429 RESOURCE_LOCKED) is fixed in
2d8527efand verified against GuildRoleService.ts:450-453 / ResourceLockedError / LockedError; origin/serveradmin merged in and the local gate passed on the merged head. Labelling ready-to-merge.Merged into
serveradminby hand (the merge API returns 405); the commits are in the branch.Pull request closed