Skip to content

Commit b1ed972

Browse files
authored
Use stable calls to /room_keys (#2729)
* Use stable calls to `/room_keys` Fixes element-hq/element-web#22839 * Appease the CI
1 parent 2f24e90 commit b1ed972

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
27002700
try {
27012701
res = await this.http.authedRequest<IKeyBackupInfo>(
27022702
undefined, Method.Get, "/room_keys/version", undefined, undefined,
2703-
{ prefix: PREFIX_UNSTABLE },
2703+
{ prefix: PREFIX_V3 },
27042704
);
27052705
} catch (e) {
27062706
if (e.errcode === 'M_NOT_FOUND') {
@@ -2856,7 +2856,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
28562856

28572857
const res = await this.http.authedRequest<IKeyBackupInfo>(
28582858
undefined, Method.Post, "/room_keys/version", undefined, data,
2859-
{ prefix: PREFIX_UNSTABLE },
2859+
{ prefix: PREFIX_V3 },
28602860
);
28612861

28622862
// We could assume everything's okay and enable directly, but this ensures
@@ -2888,7 +2888,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
28882888

28892889
return this.http.authedRequest(
28902890
undefined, Method.Delete, path, undefined, undefined,
2891-
{ prefix: PREFIX_UNSTABLE },
2891+
{ prefix: PREFIX_V3 },
28922892
);
28932893
}
28942894

src/crypto/EncryptionSetup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { logger } from "../logger";
1818
import { MatrixEvent } from "../models/event";
1919
import { createCryptoStoreCacheCallbacks, ICacheCallbacks } from "./CrossSigning";
2020
import { IndexedDBCryptoStore } from './store/indexeddb-crypto-store';
21-
import { Method, PREFIX_UNSTABLE } from "../http-api";
21+
import { Method, PREFIX_V3 } from "../http-api";
2222
import { Crypto, IBootstrapCrossSigningOpts } from "./index";
2323
import {
2424
ClientEvent,
@@ -246,14 +246,14 @@ export class EncryptionSetupOperation {
246246
algorithm: this.keyBackupInfo.algorithm,
247247
auth_data: this.keyBackupInfo.auth_data,
248248
},
249-
{ prefix: PREFIX_UNSTABLE },
249+
{ prefix: PREFIX_V3 },
250250
);
251251
} else {
252252
// add new key backup
253253
await baseApis.http.authedRequest(
254254
undefined, Method.Post, "/room_keys/version",
255255
undefined, this.keyBackupInfo,
256-
{ prefix: PREFIX_UNSTABLE },
256+
{ prefix: PREFIX_V3 },
257257
);
258258
}
259259
}

0 commit comments

Comments
 (0)