






















@@ -74,6 +74,10 @@ type MatrixQaCliVerificationStatus = {
7474};
7575backupVersion?: string | null;
7676crossSigningVerified?: boolean;
77+encryptionEnabled?: boolean;
78+pendingVerifications?: number;
79+recoveryKeyStored?: boolean;
80+serverDeviceKnown?: boolean;
7781verified?: boolean;
7882signedByOwner?: boolean;
7983deviceId?: string | null;
@@ -1785,6 +1789,39 @@ function assertMatrixQaCliE2eeStatus(
17851789}
17861790}
178717911792+function assertMatrixQaCliAccountAddBootstrapStatus(params: {
1793+expectedBackupVersion?: string | null;
1794+expectedUserId: string;
1795+status: MatrixQaCliVerificationStatus;
1796+}) {
1797+const { expectedBackupVersion, expectedUserId, status } = params;
1798+if (status.encryptionEnabled !== true || status.recoveryKeyStored !== true) {
1799+throw new Error(
1800+"Matrix CLI account add --enable-e2ee degraded status did not keep encryption and recovery key state",
1801+);
1802+}
1803+if (status.userId !== expectedUserId) {
1804+throw new Error(
1805+`Matrix CLI account add --enable-e2ee status user mismatch: expected ${expectedUserId}, got ${status.userId ?? "<none>"}`,
1806+);
1807+}
1808+if (!status.deviceId || status.serverDeviceKnown !== true) {
1809+throw new Error(
1810+"Matrix CLI account add --enable-e2ee degraded status did not resolve the current server-known device",
1811+);
1812+}
1813+if (expectedBackupVersion && status.backupVersion !== expectedBackupVersion) {
1814+throw new Error(
1815+`Matrix CLI account add --enable-e2ee backup version mismatch: expected ${expectedBackupVersion}, got ${status.backupVersion ?? "<none>"}`,
1816+);
1817+}
1818+if (status.backup?.keyLoadError) {
1819+throw new Error(
1820+`Matrix CLI account add --enable-e2ee degraded status reported backup key error: ${status.backup.keyLoadError}`,
1821+);
1822+}
1823+}
1824+17881825async function runMatrixQaCliExpectedFailure(params: {
17891826args: string[];
17901827start: (args: string[], timeoutMs?: number) => MatrixQaCliSession;
@@ -1940,7 +1977,11 @@ export async function runMatrixQaE2eeCliAccountAddEnableE2eeScenario(
19401977rootDir: cli.rootDir,
19411978});
19421979const status = parseMatrixQaCliJson(statusResult) as MatrixQaCliVerificationStatus;
1943-assertMatrixQaCliE2eeStatus("Matrix CLI account add --enable-e2ee", status);
1980+assertMatrixQaCliAccountAddBootstrapStatus({
1981+expectedBackupVersion: added.verificationBootstrap.backupVersion,
1982+expectedUserId: account.userId,
1983+ status,
1984+});
19441985const cliDeviceId = status.deviceId ?? null;
1945198619461987return {
@@ -1953,7 +1994,7 @@ export async function runMatrixQaE2eeCliAccountAddEnableE2eeScenario(
19531994verificationBootstrapSuccess: added.verificationBootstrap.success,
19541995},
19551996details: [
1956-"Matrix CLI account add --enable-e2ee created an encrypted, verified account",
1997+"Matrix CLI account add --enable-e2ee created an encrypted account and bootstrapped recovery state",
19571998`account add stdout: ${addArtifacts.stdoutPath}`,
19581999`account add stderr: ${addArtifacts.stderrPath}`,
19592000`verify status stdout: ${statusArtifacts.stdoutPath}`,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。