Soundboard 55: fluxer-proto and fluxer-api entrance-sound library endpoints #384

Closed
opened 2026-11-13 01:40:48 +00:00 by charles · 0 comments
Owner

Plan: docs/superpowers/plans/2026-11-12-textchat.md, section "Task 55" (Soundboard and entrance sounds, added 2026-11-12, high priority per Charles).

Task 55: fluxer-proto and fluxer-api entrance-sound library endpoints

Issue: (to be created)
Closes: none (the protocol half of #142's entrance-sound items).

Touches two crates, serialised: the proto commit first, then the api commit on top.

Files:

  • Modify: crates/fluxer-proto/src/models/soundboard.rs, crates/fluxer-proto/src/{limits.rs,lib.rs}, crates/fluxer-proto/README.md; crates/fluxer-api/src/voice.rs, crates/fluxer-api/README.md
  • Test: crates/fluxer-proto/tests/soundboard.rs, crates/fluxer-proto/tests/spec_contract.rs, crates/fluxer-api/tests/voice.rs (wiremock, as the existing entrance tests)

Interfaces:

  • Produces (proto): EntranceSoundUploadRequest { name: String, audio: String } (audio = standard base64 without a data: prefix, as readBlobAsBase64NoPrefix); EntranceSoundRenameRequest { name: String }; EntranceSoundSelectionRequest { scope_id: String, sound_id: Option<Snowflake> } — sound_id: None serialises as null (the server requires the key; no skip_serializing_if); EntranceSoundScope::{Global, Guilds, Dms, Guild(Snowflake)} with id(&self) -> String (global, guilds, dms, guild:<id>), parse(&str) -> Option<Self>, fallbacks(&self) -> Vec<Self> (EntranceSoundScopes.ts:65-74: guild → [guild, guilds, global], dms → [dms, global], guilds → [guilds, global], global → [global]) and for_voice(guild_id: Option<Snowflake>) -> Self (None → Dms); constants from const/EntranceSoundConstants.ts and const/SoundboardConstants.ts: ENTRANCE_SOUND_MAX_PER_USER: usize = 8, ENTRANCE_SOUND_MAX_BYTES: usize = 1_048_576, ENTRANCE_SOUND_MAX_DURATION: Duration = 5200 ms, ENTRANCE_SOUND_MIN_DURATION: Duration = 100 ms, ENTRANCE_SOUND_NAME_MAX_CHARS: usize = 32, SOUNDBOARD_SOUND_MAX_DURATION: Duration = 30 s, SOUNDBOARD_SOUND_MIN_DURATION: Duration = 100 ms; limits::FEATURE_VOICE_ENTRANCE_SOUNDS = "feature_voice_entrance_sounds" with default_limit Some(0.0) (the original's fallback 0).

  • Produces (api, ApiClient): upload_entrance_sound(&self, name: &str, audio: &[u8]) -> Result<EntranceSound> (POST /users/@me/entrance-sounds, 201), rename_entrance_sound(&self, sound: Snowflake, name: &str) -> Result<EntranceSound> (PATCH /users/@me/entrance-sounds/{id}), delete_entrance_sound(&self, sound: Snowflake) -> Result<()> (204), set_entrance_sound_selection(&self, scope: &EntranceSoundScope, sound: Option<Snowflake>) -> Result<()> (PUT /users/@me/entrance-sound-selections, 204). A 400 with the server's validation code (ENTRANCE_SOUND_QUOTA_REACHED, ENTRANCE_SOUND_SIZE_EXCEEDS_LIMIT, ENTRANCE_SOUND_DURATION_EXCEEDS_LIMIT, ENTRANCE_SOUND_INVALID_FORMAT) comes back as the existing validation error variant with that code. Neither the body nor the audio is logged.

  • Step 1: Write failing tests: proto — entrance_upload_request_shape (shaped like api/user/entrance_sound/EntranceSoundController.ts:72-96 and EntranceSoundUploadRequest in spec/openapi.json), selection_request_clear_serialises_null_sound_id, scope_ids_round_trip, scope_parse_rejects_unknown_and_empty_guild, scope_fallbacks_match_the_original, for_voice_without_guild_is_dms, entrance_limits_match_the_server_constants, spec_contract_entrance_requests (against spec/openapi.json); api — upload_entrance_sound_posts_base64_and_parses_201, rename_entrance_sound_patches_name, delete_entrance_sound_expects_204, set_selection_puts_scope_and_null, quota_reached_is_a_validation_error_with_its_code.

  • Step 2–5: FAIL → implement (pro

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 55" (Soundboard and entrance sounds, added 2026-11-12, high priority per Charles). ### Task 55: `fluxer-proto` and `fluxer-api` entrance-sound library endpoints **Issue:** (to be created) **Closes:** none (the protocol half of #142's entrance-sound items). Touches two crates, serialised: the proto commit first, then the api commit on top. **Files:** - Modify: `crates/fluxer-proto/src/models/soundboard.rs`, `crates/fluxer-proto/src/{limits.rs,lib.rs}`, `crates/fluxer-proto/README.md`; `crates/fluxer-api/src/voice.rs`, `crates/fluxer-api/README.md` - Test: `crates/fluxer-proto/tests/soundboard.rs`, `crates/fluxer-proto/tests/spec_contract.rs`, `crates/fluxer-api/tests/voice.rs` (wiremock, as the existing entrance tests) **Interfaces:** - Produces (proto): `EntranceSoundUploadRequest { name: String, audio: String }` (`audio` = standard base64 without a `data:` prefix, as `readBlobAsBase64NoPrefix`); `EntranceSoundRenameRequest { name: String }`; `EntranceSoundSelectionRequest { scope_id: String, sound_id: Option<Snowflake> }` — `sound_id: None` serialises as `null` (the server requires the key; no `skip_serializing_if`); `EntranceSoundScope::{Global, Guilds, Dms, Guild(Snowflake)}` with `id(&self) -> String` (`global`, `guilds`, `dms`, `guild:<id>`), `parse(&str) -> Option<Self>`, `fallbacks(&self) -> Vec<Self>` (`EntranceSoundScopes.ts:65-74`: guild → [guild, guilds, global], dms → [dms, global], guilds → [guilds, global], global → [global]) and `for_voice(guild_id: Option<Snowflake>) -> Self` (`None` → `Dms`); constants from `const/EntranceSoundConstants.ts` and `const/SoundboardConstants.ts`: `ENTRANCE_SOUND_MAX_PER_USER: usize = 8`, `ENTRANCE_SOUND_MAX_BYTES: usize = 1_048_576`, `ENTRANCE_SOUND_MAX_DURATION: Duration = 5200 ms`, `ENTRANCE_SOUND_MIN_DURATION: Duration = 100 ms`, `ENTRANCE_SOUND_NAME_MAX_CHARS: usize = 32`, `SOUNDBOARD_SOUND_MAX_DURATION: Duration = 30 s`, `SOUNDBOARD_SOUND_MIN_DURATION: Duration = 100 ms`; `limits::FEATURE_VOICE_ENTRANCE_SOUNDS = "feature_voice_entrance_sounds"` with `default_limit` `Some(0.0)` (the original's fallback 0). - Produces (api, `ApiClient`): `upload_entrance_sound(&self, name: &str, audio: &[u8]) -> Result<EntranceSound>` (`POST /users/@me/entrance-sounds`, 201), `rename_entrance_sound(&self, sound: Snowflake, name: &str) -> Result<EntranceSound>` (`PATCH /users/@me/entrance-sounds/{id}`), `delete_entrance_sound(&self, sound: Snowflake) -> Result<()>` (204), `set_entrance_sound_selection(&self, scope: &EntranceSoundScope, sound: Option<Snowflake>) -> Result<()>` (`PUT /users/@me/entrance-sound-selections`, 204). A 400 with the server's validation code (`ENTRANCE_SOUND_QUOTA_REACHED`, `ENTRANCE_SOUND_SIZE_EXCEEDS_LIMIT`, `ENTRANCE_SOUND_DURATION_EXCEEDS_LIMIT`, `ENTRANCE_SOUND_INVALID_FORMAT`) comes back as the existing validation error variant with that code. Neither the body nor the audio is logged. - [ ] **Step 1: Write failing tests**: proto — `entrance_upload_request_shape` (shaped like `api/user/entrance_sound/EntranceSoundController.ts:72-96` and `EntranceSoundUploadRequest` in `spec/openapi.json`), `selection_request_clear_serialises_null_sound_id`, `scope_ids_round_trip`, `scope_parse_rejects_unknown_and_empty_guild`, `scope_fallbacks_match_the_original`, `for_voice_without_guild_is_dms`, `entrance_limits_match_the_server_constants`, `spec_contract_entrance_requests` (against `spec/openapi.json`); api — `upload_entrance_sound_posts_base64_and_parses_201`, `rename_entrance_sound_patches_name`, `delete_entrance_sound_expects_204`, `set_selection_puts_scope_and_null`, `quota_reached_is_a_validation_error_with_its_code`. - [ ] **Step 2–5:** FAIL → implement (pro 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-13 01:40:48 +00:00
Sign in to join this conversation.
No milestone
No project
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#384
No description provided.