Repository navigation
fix(admin): restore rename_all guard on WorkerRow and pin wire spelling (#1221) - #1291
Conversation
🦋 Changeset detectedLatest commit: 6772feb The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
[Low impact] The PR appears safe to merge; existing JSON keys remain unchanged.
|
Description
Restores
#[serde(rename_all = "camelCase")]onWorkerRowincrates/nostream-admin/src/utils/workers.rs, and adds unit tests that pin the wire spelling of each field and verify camelCase serialization and deserialization.Related Issue
Closes #1221
Motivation and Context
When
WorkerRowgainedDeserializefor use in the published status document, it lost its#[serde(rename_all = "camelCase")]attribute. While all current fields were single-word (type,index,enabled,label,heartbeat,monitored,stale), any future multi-word field would serialize assnake_caseinto artifacts read by the admin console.Restoring the attribute and adding pinning tests guarantees that the wire format remains camelCase and prevents silent casing drift.
How Has This Been Tested?
crates/nostream-admin/src/utils/workers.rs:worker_row_wire_keys_are_camel_case_and_pinned: pins the exact wire key names and ensures round-trip serialization.worker_row_deserializes_from_camel_case_json: ensures deserialization from camelCase wire JSON.nostream-admin:cargo test -p nostream-admin --lib(56/56 passed)cargo test -p nostream-admin(all 163 passed)cargo fmt --check --package nostream-admincargo clippy -p nostream-admin --all-targets --all-features -- -D warnings-D clippy::unwrap_used -D clippy::expect_usedTypes of changes
Checklist: