diff --git a/apps/web/playwright/e2e/crypto/history-sharing.spec.ts b/apps/web/playwright/e2e/crypto/history-sharing.spec.ts
index 29676036ba..cefa38b580 100644
--- a/apps/web/playwright/e2e/crypto/history-sharing.spec.ts
+++ b/apps/web/playwright/e2e/crypto/history-sharing.spec.ts
@@ -13,7 +13,6 @@ import { createRoom, sendMessageInCurrentRoom } from "./utils";
test.use({
displayName: "Alice",
- labsFlags: ["feature_share_history_on_invite"],
});
/** Tests for MSC4268: encrypted history sharing */
diff --git a/apps/web/playwright/snapshots/invite/invite-dialog.spec.ts/send-your-first-message-view-linux.png b/apps/web/playwright/snapshots/invite/invite-dialog.spec.ts/send-your-first-message-view-linux.png
index 9b14c9e11b..7e795251a8 100644
Binary files a/apps/web/playwright/snapshots/invite/invite-dialog.spec.ts/send-your-first-message-view-linux.png and b/apps/web/playwright/snapshots/invite/invite-dialog.spec.ts/send-your-first-message-view-linux.png differ
diff --git a/apps/web/src/components/views/rooms/RoomHeader/RoomHeader.tsx b/apps/web/src/components/views/rooms/RoomHeader/RoomHeader.tsx
index 21087c3044..d16ed4b8e3 100644
--- a/apps/web/src/components/views/rooms/RoomHeader/RoomHeader.tsx
+++ b/apps/web/src/components/views/rooms/RoomHeader/RoomHeader.tsx
@@ -446,7 +446,6 @@ export default function RoomHeader({
const roomName = useRoomName(room);
const joinRule = useRoomState(room, (state) => state.getJoinRule());
const historyVisibility = useRoomState(room, (state) => state.getHistoryVisibility());
- const historySharingEnabled = useFeatureEnabled("feature_share_history_on_invite");
const dmMember = useDmMember(room);
const isDirectMessage = !!dmMember;
const isRoomEncrypted = useIsEncrypted(client, room);
@@ -532,7 +531,7 @@ export default function RoomHeader({
)}
- {isRoomEncrypted && historySharingEnabled && historyVisibilityIcon(historyVisibility)}
+ {isRoomEncrypted && historyVisibilityIcon(historyVisibility)}
diff --git a/apps/web/src/i18n/strings/en_EN.json b/apps/web/src/i18n/strings/en_EN.json
index 3f628fc958..6405d2fe7b 100644
--- a/apps/web/src/i18n/strings/en_EN.json
+++ b/apps/web/src/i18n/strings/en_EN.json
@@ -1577,9 +1577,6 @@
"report_to_moderators": "Report to moderators",
"report_to_moderators_description": "In rooms that support moderation, the “Report” button will let you report abuse to room moderators.",
"room_list_sections": "Room list sections",
- "share_history_on_invite": "Share encrypted history with new members",
- "share_history_on_invite_description": "When inviting a user to an encrypted room that has history visibility set to \"shared\", share encrypted history with that user, and accept encrypted history when you are invited to such a room.",
- "share_history_on_invite_warning": "This feature is EXPERIMENTAL and not all security precautions are implemented. Do not enable on production accounts.",
"sliding_sync": "Sliding Sync mode",
"sliding_sync_description": "Under active development, cannot be disabled. Currently, not compatible with Element Call.",
"sliding_sync_disabled_notice": "Sign in again to disable",
diff --git a/apps/web/src/settings/Settings.tsx b/apps/web/src/settings/Settings.tsx
index 4b05f7320c..67d0a31e14 100644
--- a/apps/web/src/settings/Settings.tsx
+++ b/apps/web/src/settings/Settings.tsx
@@ -212,7 +212,6 @@ export interface Settings {
"feature_mjolnir": IFeature;
"feature_custom_themes": IFeature;
"feature_exclude_insecure_devices": IFeature;
- "feature_share_history_on_invite": IFeature;
"feature_html_topic": IFeature;
"feature_bridge_state": IFeature;
"feature_jump_to_date": IFeature;
@@ -522,29 +521,6 @@ export const SETTINGS: Settings = {
supportedLevelsAreOrdered: true,
default: false,
},
- "feature_share_history_on_invite": {
- isFeature: true,
- labsGroup: LabGroup.Encryption,
- displayName: _td("labs|share_history_on_invite"),
- description: () => (
- <>
- {_t("labs|share_history_on_invite_description")}
-
- {_t(
- "settings|warning",
- {},
- {
- w: (sub) => {sub} ,
- description: _t("labs|share_history_on_invite_warning"),
- },
- )}
-
- >
- ),
- supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED,
- supportedLevelsAreOrdered: true,
- default: false,
- },
// Defaulted to true Feb 26, intention is to remove entirely, all being well,
// as this fixes bugs where display name / avatar are missing and also makes
// Element Web consistent with Element X.
diff --git a/apps/web/src/stores/RoomViewStore.tsx b/apps/web/src/stores/RoomViewStore.tsx
index 7d06391e32..f875d2f26d 100644
--- a/apps/web/src/stores/RoomViewStore.tsx
+++ b/apps/web/src/stores/RoomViewStore.tsx
@@ -544,11 +544,9 @@ export class RoomViewStore extends EventEmitter {
const joinOpts: IJoinRoomOpts = {
viaServers,
+ acceptSharedHistory: true,
...(payload.opts ?? {}),
};
- if (SettingsStore.getValue("feature_share_history_on_invite")) {
- joinOpts.acceptSharedHistory = true;
- }
try {
const cli = MatrixClientPeg.safeGet();
await retry(
diff --git a/apps/web/src/utils/MultiInviter.ts b/apps/web/src/utils/MultiInviter.ts
index 46fd84cc26..09ae6adb9c 100644
--- a/apps/web/src/utils/MultiInviter.ts
+++ b/apps/web/src/utils/MultiInviter.ts
@@ -228,10 +228,10 @@ export default class MultiInviter {
}
}
- const opts: InviteOpts = {};
+ const opts: InviteOpts = {
+ shareEncryptedHistory: true,
+ };
if (this.reason !== undefined) opts.reason = this.reason;
- if (SettingsStore.getValue("feature_share_history_on_invite")) opts.shareEncryptedHistory = true;
-
return this.matrixClient.invite(roomId, addr, opts);
} else {
throw new Error("Unsupported address");
diff --git a/apps/web/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap b/apps/web/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap
index 40df5cb41e..745d84f52b 100644
--- a/apps/web/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap
+++ b/apps/web/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap
@@ -212,7 +212,7 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
Could not start a chat with this user
@@ -417,7 +417,7 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
>
@user:example.com
+
@@ -2838,6 +2856,24 @@ exports[`RoomView should not display the timeline when the room encryption is lo
>
!roomviewshouldnotdisplaythetimelinewhentheroomencryptionisloading:example.org
+
@@ -3023,7 +3059,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
tabindex="0"
>
({
@@ -723,25 +722,9 @@ describe("RoomHeader", () => {
],
{ addToState: true },
);
- let featureEnabled = true;
- jest.spyOn(SettingsStore, "getValue").mockImplementation(
- (flag) => flag === "feature_share_history_on_invite" && featureEnabled,
- );
render( , getWrapper());
await waitFor(() => getByLabelText(document.body, "New members see history"));
-
- // Disable the labs flag and check the icon disappears
- featureEnabled = false;
- act(() =>
- defaultWatchManager.notifyUpdate(
- "feature_share_history_on_invite",
- null,
- SettingLevel.DEVICE,
- featureEnabled,
- ),
- );
- expect(queryByLabelText(document.body, "New members see history")).not.toBeInTheDocument();
});
it("shows a user icon if the room is encrypted and has world readable history", async () => {
@@ -758,10 +741,6 @@ describe("RoomHeader", () => {
],
{ addToState: true },
);
- const featureEnabled = true;
- jest.spyOn(SettingsStore, "getValue").mockImplementation(
- (flag) => flag === "feature_share_history_on_invite" && featureEnabled,
- );
render( , getWrapper());
await waitFor(() => getByLabelText(document.body, "Anyone can see history"));
diff --git a/apps/web/test/unit-tests/components/views/rooms/RoomHeader/__snapshots__/RoomHeader-test.tsx.snap b/apps/web/test/unit-tests/components/views/rooms/RoomHeader/__snapshots__/RoomHeader-test.tsx.snap
index 577c7983ce..90f3fe474f 100644
--- a/apps/web/test/unit-tests/components/views/rooms/RoomHeader/__snapshots__/RoomHeader-test.tsx.snap
+++ b/apps/web/test/unit-tests/components/views/rooms/RoomHeader/__snapshots__/RoomHeader-test.tsx.snap
@@ -56,7 +56,7 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
style="--cpd-icon-button-size: 100%;"
>
{
await command.run(client, roomId, null, args).promise;
- expect(client.invite).toHaveBeenCalledWith(roomId, "@u:s.co", {});
+ expect(client.invite).toHaveBeenCalledWith(roomId, "@u:s.co", { shareEncryptedHistory: true });
});
it("should provide the invite reason if we supply it", async () => {
@@ -35,6 +35,9 @@ describe("/invite", () => {
await command.run(client, roomId, null, args).promise;
- expect(client.invite).toHaveBeenCalledWith(roomId, "@u:s.co", { reason: "They are a very nice person" });
+ expect(client.invite).toHaveBeenCalledWith(roomId, "@u:s.co", {
+ reason: "They are a very nice person",
+ shareEncryptedHistory: true,
+ });
});
});
diff --git a/apps/web/test/unit-tests/stores/RoomViewStore-test.ts b/apps/web/test/unit-tests/stores/RoomViewStore-test.ts
index 69e806bb04..af3ff5bf56 100644
--- a/apps/web/test/unit-tests/stores/RoomViewStore-test.ts
+++ b/apps/web/test/unit-tests/stores/RoomViewStore-test.ts
@@ -213,7 +213,7 @@ describe("RoomViewStore", function () {
dis.dispatch({ action: Action.ViewRoom, room_id: roomId });
dis.dispatch({ action: Action.JoinRoom });
await untilDispatch(Action.JoinRoomReady, dis);
- expect(mockClient.joinRoom).toHaveBeenCalledWith(roomId, { viaServers: [] });
+ expect(mockClient.joinRoom).toHaveBeenCalledWith(roomId, { acceptSharedHistory: true, viaServers: [] });
expect(roomViewStore.isJoining()).toBe(true);
});
@@ -229,14 +229,14 @@ describe("RoomViewStore", function () {
}),
);
await untilDispatch(Action.JoinRoomReady, dis);
- expect(mockClient.joinRoom).toHaveBeenCalledWith(alias, { viaServers: ["server1"] });
+ expect(mockClient.joinRoom).toHaveBeenCalledWith(alias, { acceptSharedHistory: true, viaServers: ["server1"] });
expect(roomViewStore.isJoining()).toBe(true);
});
it("can auto-join a room", async () => {
dis.dispatch({ action: Action.ViewRoom, room_id: roomId, auto_join: true });
await untilDispatch(Action.JoinRoomReady, dis);
- expect(mockClient.joinRoom).toHaveBeenCalledWith(roomId, { viaServers: [] });
+ expect(mockClient.joinRoom).toHaveBeenCalledWith(roomId, { acceptSharedHistory: true, viaServers: [] });
expect(roomViewStore.isJoining()).toBe(true);
});
@@ -282,7 +282,7 @@ describe("RoomViewStore", function () {
await untilDispatch(Action.JoinRoomReady, dis);
expect(roomViewStore.isJoining()).toBeTruthy();
- expect(mockClient.joinRoom).toHaveBeenCalledWith(alias, { viaServers: [] });
+ expect(mockClient.joinRoom).toHaveBeenCalledWith(alias, { acceptSharedHistory: true, viaServers: [] });
});
it("emits ViewRoomError if the alias lookup fails", async () => {
@@ -548,11 +548,7 @@ describe("RoomViewStore", function () {
expect(mocked(dis.dispatch).mock.calls[2][0]).toEqual({ action: "prompt_ask_to_join" });
});
- it("sets 'acceptSharedHistory' if that option is enabled", async () => {
- jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName, roomId, value) => {
- return settingName === "feature_share_history_on_invite"; // this is enabled, everything else is disabled.
- });
-
+ it("sets 'acceptSharedHistory'", async () => {
dis.dispatch({ action: Action.ViewRoom, room_id: roomId });
dis.dispatch({ action: Action.JoinRoom });
await untilDispatch(Action.JoinRoomReady, dis);
diff --git a/apps/web/test/unit-tests/utils/MultiInviter-test.ts b/apps/web/test/unit-tests/utils/MultiInviter-test.ts
index b898ea2a24..eda6d9baa6 100644
--- a/apps/web/test/unit-tests/utils/MultiInviter-test.ts
+++ b/apps/web/test/unit-tests/utils/MultiInviter-test.ts
@@ -120,9 +120,9 @@ describe("MultiInviter", () => {
const result = await inviter.invite([MXID1, MXID2, MXID3]);
expect(client.invite).toHaveBeenCalledTimes(3);
- expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, {});
- expect(client.invite).toHaveBeenNthCalledWith(2, ROOMID, MXID2, {});
- expect(client.invite).toHaveBeenNthCalledWith(3, ROOMID, MXID3, {});
+ expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, { shareEncryptedHistory: true });
+ expect(client.invite).toHaveBeenNthCalledWith(2, ROOMID, MXID2, { shareEncryptedHistory: true });
+ expect(client.invite).toHaveBeenNthCalledWith(3, ROOMID, MXID3, { shareEncryptedHistory: true });
expectAllInvitedResult(result);
});
@@ -138,9 +138,9 @@ describe("MultiInviter", () => {
const result = await inviter.invite([MXID1, MXID2, MXID3]);
expect(client.invite).toHaveBeenCalledTimes(3);
- expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, {});
- expect(client.invite).toHaveBeenNthCalledWith(2, ROOMID, MXID2, {});
- expect(client.invite).toHaveBeenNthCalledWith(3, ROOMID, MXID3, {});
+ expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, { shareEncryptedHistory: true });
+ expect(client.invite).toHaveBeenNthCalledWith(2, ROOMID, MXID2, { shareEncryptedHistory: true });
+ expect(client.invite).toHaveBeenNthCalledWith(3, ROOMID, MXID3, { shareEncryptedHistory: true });
expectAllInvitedResult(result);
});
@@ -153,7 +153,7 @@ describe("MultiInviter", () => {
const result = await inviter.invite([MXID1, MXID2, MXID3]);
expect(client.invite).toHaveBeenCalledTimes(1);
- expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, {});
+ expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, { shareEncryptedHistory: true });
// The resolved state is 'invited' for all users.
// With the above client expectations, the test ensures that only the first user is invited.
@@ -255,15 +255,5 @@ describe("MultiInviter", () => {
`"This space is unfederated. You cannot invite people from external servers."`,
);
});
-
- it("should set shareEncryptedHistory if that setting is enabled", async () => {
- mocked(SettingsStore.getValue).mockImplementation((settingName, roomId, value) => {
- return settingName === "feature_share_history_on_invite"; // this is enabled, everything else is disabled.
- });
- await inviter.invite([MXID1]);
-
- expect(client.invite).toHaveBeenCalledTimes(1);
- expect(client.invite).toHaveBeenNthCalledWith(1, ROOMID, MXID1, { shareEncryptedHistory: true });
- });
});
});
diff --git a/docs/labs.md b/docs/labs.md
index aba48767e0..7919c4737f 100644
--- a/docs/labs.md
+++ b/docs/labs.md
@@ -119,14 +119,6 @@ Do not send or receive messages to/from devices that are not properly verified.
receive your messages at all on those devices, and if they send messages, you will not be able to read them, but you
will be aware that a message exists.
-## Share encrypted history with new members (`feature_share_history_on_invite`) [In Development]
-
-When inviting users to an encrypted room with shared history (i.e. a room with the "Who can read history?" setting set
-to "Members only (since the point in time of selecting this option)"), send the keys for previous messages to the
-invitee so they can read them.
-
-Both the inviter and the invitee must set this labs flag, before the invitation is sent.
-
## Encrypted state events (MSC4362) (`feature_msc4362_encrypted_state_events`)
Encrypt most of the state events in the room, including the room name and topic.