Add config param to disable client wellknown fetch (#34084)
* Add enable_client_well_known_lookups config option Signed-off-by: David Langley <langley.dave@gmail.com> * Gate client .well-known poll on enable_client_well_known_lookups Signed-off-by: David Langley <langley.dave@gmail.com> * Gate MatrixRTC foci well-known fallback on enable_client_well_known_lookups Signed-off-by: David Langley <langley.dave@gmail.com> --------- Signed-off-by: David Langley <langley.dave@gmail.com> Co-authored-by: David Langley <langley.dave@gmail.com>
This commit is contained in:
co-authored by
David Langley
parent
c4606c19f8
commit
6aeb5f552b
@@ -11,6 +11,7 @@ import { type MockedObject } from "jest-mock";
|
||||
|
||||
import { ElementCall } from "../../../src/models/Call";
|
||||
import { CallStore } from "../../../src/stores/CallStore";
|
||||
import SdkConfig from "../../../src/SdkConfig";
|
||||
import {
|
||||
setUpClientRoomAndStores,
|
||||
cleanUpClientRoomAndStores,
|
||||
@@ -66,4 +67,20 @@ describe("CallStore", () => {
|
||||
{ type: "type-d", other_data: "baz" },
|
||||
]);
|
||||
});
|
||||
it("does not fall back to client well-known when enable_client_well_known_lookups is false", async () => {
|
||||
const sdkConfigGet = SdkConfig.get;
|
||||
jest.spyOn(SdkConfig, "get").mockImplementation((key?: any, altCaseName?: string): any => {
|
||||
if (key === "enable_client_well_known_lookups") return false;
|
||||
return sdkConfigGet(key, altCaseName);
|
||||
});
|
||||
client._unstable_getRTCTransports.mockResolvedValue([{ type: "type-a", some_data: "value" }]);
|
||||
client.getClientWellKnown.mockReturnValue({
|
||||
"org.matrix.msc4143.rtc_foci": [{ type: "type-c", other_data: "bar" }],
|
||||
});
|
||||
await setupAsyncStoreWithClient(CallStore.instance, client);
|
||||
// Only the modern endpoint contributes; the legacy well-known fallback is skipped entirely.
|
||||
expect(CallStore.instance.getConfiguredRTCTransports()).toEqual([{ type: "type-a", some_data: "value" }]);
|
||||
expect(client.waitForClientWellKnown).not.toHaveBeenCalled();
|
||||
expect(client.getClientWellKnown).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user