fix(copy): report password setup and storage contention accurately
Current typed producers distinguish invalid password settings, hashing failure, denied admission and SQLite contention. Match those codes instead of treating any password sentence as a wrong password. RoomStorageInUse stays typed and serializes its code without a redundant room ID. The four Native hosted-room tests and the full 2521-test Web suite pass.
This commit is contained in:
1 parent
7291e66f0e
commit
ec34b77aec
8 files changed
+34
-25
No files matched your search
@@ -15,7 +15,7 @@ export function channelErrorPresentation(error: string | null, t: (key: CopyKey,
|
||||
if (!error) return { message: null, connectionHelp: true };
|
||||
const diagnosis = diagnoseChannelFact({ area: "error", code: error });
|
||||
if (diagnosis) return display(diagnosis.message);
|
||||
if (error === "room_busy" || error === "capture_pending") return display("channel.error.busy");
|
||||
if (error === "room_busy" || error === "capture_pending" || error === "storage_busy") return display("channel.error.busy");
|
||||
if (error === "room_creation_restricted") return display("channel.error.roomCreationRestricted");
|
||||
if (error === "room_limit") return display("channel.error.roomLimit");
|
||||
if (error === "file_transfer_interrupted") return display("channel.attachment.transferInterrupted");
|
||||
@@ -128,12 +128,12 @@ export function channelErrorPresentation(error: string | null, t: (key: CopyKey,
|
||||
return display("channel.error.videoCodecUnsupported");
|
||||
if (error === "owner_mismatch")
|
||||
return display("channel.error.ownerMismatch");
|
||||
if (/room_host_conflict|room_storage_in_use/.test(error))
|
||||
if (error === "room_host_conflict" || error === "room_storage_in_use")
|
||||
return display("channel.error.roomHostConflict");
|
||||
if (/^(?:room_unavailable|room_not_found|invalid_room_id)$/.test(error))
|
||||
return display("channel.error.roomUnavailable");
|
||||
if (/password/i.test(error))
|
||||
return display("channel.error.passwordIncorrect");
|
||||
if (error === "invalid_room_password") return display("channel.error.invalidRoomPassword");
|
||||
if (error === "password_failed") return display("channel.error.setRoomPasswordFailed");
|
||||
if (/room_access|room_forbidden/i.test(error))
|
||||
return display("channel.error.roomAccessDenied");
|
||||
if (/invit(?:e|ation)/i.test(error))
|
||||
|
||||
Reference in new issue
Block a user