Extend SignalingTariff type, add StorageQuotaChanged WS event types and wire initial state
Summary
The backend sends a StorageQuotaChanged event over the signaling WebSocket and will include usedQuota in the join_success tariff payload.
The backend Quota struct is:
pub struct Quota {
pub total: Option<u64>, // None = unlimited
pub used: u64,
}
Implementation details
- In joinSuccess.ts, extend
SignalingTariff:
export interface SignalingTariff {
id: TariffId;
name: string;
quotas: Record<string, number>;
usedQuota: Record<string, number>; // NEW
disabledFeatures: BackendFeatures[];
}
- In core.ts incoming types, add:
export interface StorageQuotaChanged {
message: 'storage_quota_changed';
quota: {
total?: number;
used: number;
};
}
// and add | StorageQuotaChanged to the Message union
- In configSlice.ts
initialState, update:
tariff: {
id: '' as TariffId,
name: '',
quotas: {},
usedQuota: {}, // NEW
disabledFeatures: [],
},
- Remove the commented-out dead code block in core.ts
handleRoomServerCoreMessagereferencingassetStorage?.usedStorage.
Acceptance criteria
-
SignalingTariff.usedQuotafield exists with typeRecord<string, number> - TypeScript compiles without errors after the change
-
StorageQuotaChangedis part of thecore.Messagediscriminated union -
Initial Redux state for
config.tariff.usedQuotais{} -
Dead
assetStoragecomment block is removed from core.ts
Edited by Maximilian Fuß