Skip to content

Commit e563fd8

Browse files
committed
Merge remote-tracking branch 'origin/develop' into dbkr/how_on_earth_does_nobody_else_have_this_problem_with_useid
2 parents 6eb0a24 + c4638d1 commit e563fd8

14 files changed

Lines changed: 62 additions & 97 deletions

File tree

apps/web/playwright/e2e/crypto/history-sharing.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { createRoom, sendMessageInCurrentRoom } from "./utils";
1313

1414
test.use({
1515
displayName: "Alice",
16-
labsFlags: ["feature_share_history_on_invite"],
1716
});
1817

1918
/** Tests for MSC4268: encrypted history sharing */
534 Bytes
Loading

apps/web/src/components/views/rooms/RoomHeader/RoomHeader.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ export default function RoomHeader({
446446
const roomName = useRoomName(room);
447447
const joinRule = useRoomState(room, (state) => state.getJoinRule());
448448
const historyVisibility = useRoomState(room, (state) => state.getHistoryVisibility());
449-
const historySharingEnabled = useFeatureEnabled("feature_share_history_on_invite");
450449
const dmMember = useDmMember(room);
451450
const isDirectMessage = !!dmMember;
452451
const isRoomEncrypted = useIsEncrypted(client, room);
@@ -532,7 +531,7 @@ export default function RoomHeader({
532531
</Tooltip>
533532
)}
534533

535-
{isRoomEncrypted && historySharingEnabled && historyVisibilityIcon(historyVisibility)}
534+
{isRoomEncrypted && historyVisibilityIcon(historyVisibility)}
536535
</Text>
537536
</Box>
538537
</button>

apps/web/src/i18n/strings/en_EN.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,9 +1577,6 @@
15771577
"report_to_moderators": "Report to moderators",
15781578
"report_to_moderators_description": "In rooms that support moderation, the “Report” button will let you report abuse to room moderators.",
15791579
"room_list_sections": "Room list sections",
1580-
"share_history_on_invite": "Share encrypted history with new members",
1581-
"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.",
1582-
"share_history_on_invite_warning": "This feature is EXPERIMENTAL and not all security precautions are implemented. Do not enable on production accounts.",
15831580
"sliding_sync": "Sliding Sync mode",
15841581
"sliding_sync_description": "Under active development, cannot be disabled. Currently, not compatible with Element Call.",
15851582
"sliding_sync_disabled_notice": "Sign in again to disable",

apps/web/src/settings/Settings.tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ export interface Settings {
212212
"feature_mjolnir": IFeature;
213213
"feature_custom_themes": IFeature;
214214
"feature_exclude_insecure_devices": IFeature;
215-
"feature_share_history_on_invite": IFeature;
216215
"feature_html_topic": IFeature;
217216
"feature_bridge_state": IFeature;
218217
"feature_jump_to_date": IFeature;
@@ -522,29 +521,6 @@ export const SETTINGS: Settings = {
522521
supportedLevelsAreOrdered: true,
523522
default: false,
524523
},
525-
"feature_share_history_on_invite": {
526-
isFeature: true,
527-
labsGroup: LabGroup.Encryption,
528-
displayName: _td("labs|share_history_on_invite"),
529-
description: () => (
530-
<>
531-
{_t("labs|share_history_on_invite_description")}
532-
<div className="mx_SettingsFlag_microcopy">
533-
{_t(
534-
"settings|warning",
535-
{},
536-
{
537-
w: (sub) => <span className="mx_SettingsTab_microcopy_warning">{sub}</span>,
538-
description: _t("labs|share_history_on_invite_warning"),
539-
},
540-
)}
541-
</div>
542-
</>
543-
),
544-
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG_PRIORITISED,
545-
supportedLevelsAreOrdered: true,
546-
default: false,
547-
},
548524
// Defaulted to true Feb 26, intention is to remove entirely, all being well,
549525
// as this fixes bugs where display name / avatar are missing and also makes
550526
// Element Web consistent with Element X.

apps/web/src/stores/RoomViewStore.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,9 @@ export class RoomViewStore extends EventEmitter {
544544

545545
const joinOpts: IJoinRoomOpts = {
546546
viaServers,
547+
acceptSharedHistory: true,
547548
...(payload.opts ?? {}),
548549
};
549-
if (SettingsStore.getValue("feature_share_history_on_invite")) {
550-
joinOpts.acceptSharedHistory = true;
551-
}
552550
try {
553551
const cli = MatrixClientPeg.safeGet();
554552
await retry<Room, MatrixError>(

apps/web/src/utils/MultiInviter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ export default class MultiInviter {
228228
}
229229
}
230230

231-
const opts: InviteOpts = {};
231+
const opts: InviteOpts = {
232+
shareEncryptedHistory: true,
233+
};
232234
if (this.reason !== undefined) opts.reason = this.reason;
233-
if (SettingsStore.getValue("feature_share_history_on_invite")) opts.shareEncryptedHistory = true;
234-
235235
return this.matrixClient.invite(roomId, addr, opts);
236236
} else {
237237
throw new Error("Unsupported address");

apps/web/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,24 @@ exports[`RoomView for a local room in state NEW that is encrypted should match t
693693
>
694694
@user:example.com
695695
</span>
696+
<svg
697+
aria-label="New members see history"
698+
aria-labelledby="test-id-46"
699+
class="mx_RoomHeader_icon"
700+
color="var(--cpd-color-icon-info-primary)"
701+
fill="currentColor"
702+
height="16px"
703+
viewBox="0 0 24 24"
704+
width="16px"
705+
xmlns="http://www.w3.org/2000/svg"
706+
>
707+
<path
708+
d="M18.93 8A8 8 0 1 1 4 12a1 1 0 1 0-2 0c0 5.523 4.477 10 10 10s10-4.477 10-10a10 10 0 0 0-.832-4A10 10 0 0 0 12 2a9.99 9.99 0 0 0-8 3.999V4a1 1 0 0 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 0 0 0-2H5.755A7.99 7.99 0 0 1 12 4a8 8 0 0 1 6.93 4"
709+
/>
710+
<path
711+
d="M13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 .293.707l2.83 2.83a1 1 0 0 0 1.414-1.414L13 11.586z"
712+
/>
713+
</svg>
696714
</div>
697715
</div>
698716
</button>
@@ -2838,6 +2856,24 @@ exports[`RoomView should not display the timeline when the room encryption is lo
28382856
>
28392857
!roomviewshouldnotdisplaythetimelinewhentheroomencryptionisloading:example.org
28402858
</span>
2859+
<svg
2860+
aria-label="New members see history"
2861+
aria-labelledby="test-id-61"
2862+
class="mx_RoomHeader_icon"
2863+
color="var(--cpd-color-icon-info-primary)"
2864+
fill="currentColor"
2865+
height="16px"
2866+
viewBox="0 0 24 24"
2867+
width="16px"
2868+
xmlns="http://www.w3.org/2000/svg"
2869+
>
2870+
<path
2871+
d="M18.93 8A8 8 0 1 1 4 12a1 1 0 1 0-2 0c0 5.523 4.477 10 10 10s10-4.477 10-10a10 10 0 0 0-.832-4A10 10 0 0 0 12 2a9.99 9.99 0 0 0-8 3.999V4a1 1 0 0 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 0 0 0-2H5.755A7.99 7.99 0 0 1 12 4a8 8 0 0 1 6.93 4"
2872+
/>
2873+
<path
2874+
d="M13 8a1 1 0 1 0-2 0v4a1 1 0 0 0 .293.707l2.83 2.83a1 1 0 0 0 1.414-1.414L13 11.586z"
2875+
/>
2876+
</svg>
28412877
</div>
28422878
</div>
28432879
</button>
@@ -3023,7 +3059,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
30233059
tabindex="0"
30243060
>
30253061
<div
3026-
aria-labelledby="test-id-72"
3062+
aria-labelledby="test-id-74"
30273063
class="mx_E2EIcon mx_MessageComposer_e2eIcon"
30283064
data-testid="e2e-icon"
30293065
style="width: 12px; height: 12px;"

apps/web/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ import WidgetStore, { type IApp } from "../../../../../../src/stores/WidgetStore
6060
import { UIFeature } from "../../../../../../src/settings/UIFeature";
6161
import { SettingLevel } from "../../../../../../src/settings/SettingLevel";
6262
import { ElementCallMemberEventType } from "../../../../../../src/call-types";
63-
import { defaultWatchManager } from "../../../../../../src/settings/Settings.tsx";
6463

6564
jest.mock("../../../../../../src/utils/ShieldUtils");
6665
jest.mock("../../../../../../src/hooks/right-panel/useCurrentPhase", () => ({
@@ -723,25 +722,9 @@ describe("RoomHeader", () => {
723722
],
724723
{ addToState: true },
725724
);
726-
let featureEnabled = true;
727-
jest.spyOn(SettingsStore, "getValue").mockImplementation(
728-
(flag) => flag === "feature_share_history_on_invite" && featureEnabled,
729-
);
730725

731726
render(<RoomHeader room={room} />, getWrapper());
732727
await waitFor(() => getByLabelText(document.body, "New members see history"));
733-
734-
// Disable the labs flag and check the icon disappears
735-
featureEnabled = false;
736-
act(() =>
737-
defaultWatchManager.notifyUpdate(
738-
"feature_share_history_on_invite",
739-
null,
740-
SettingLevel.DEVICE,
741-
featureEnabled,
742-
),
743-
);
744-
expect(queryByLabelText(document.body, "New members see history")).not.toBeInTheDocument();
745728
});
746729

747730
it("shows a user icon if the room is encrypted and has world readable history", async () => {
@@ -758,10 +741,6 @@ describe("RoomHeader", () => {
758741
],
759742
{ addToState: true },
760743
);
761-
const featureEnabled = true;
762-
jest.spyOn(SettingsStore, "getValue").mockImplementation(
763-
(flag) => flag === "feature_share_history_on_invite" && featureEnabled,
764-
);
765744

766745
render(<RoomHeader room={room} />, getWrapper());
767746
await waitFor(() => getByLabelText(document.body, "Anyone can see history"));

apps/web/test/unit-tests/components/views/rooms/RoomHeader/__snapshots__/RoomHeader-test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
8383
style="--cpd-icon-button-size: 100%;"
8484
>
8585
<svg
86-
aria-labelledby="test-id-5"
86+
aria-labelledby="test-id-2"
8787
fill="currentColor"
8888
height="1em"
8989
viewBox="0 0 24 24"
@@ -98,7 +98,7 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
9898
</button>
9999
<button
100100
aria-label="Threads"
101-
aria-labelledby="test-id-10"
101+
aria-labelledby="test-id-4"
102102
class="_icon-button_1215g_8"
103103
data-kind="primary"
104104
role="button"
@@ -125,7 +125,7 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
125125
</button>
126126
<button
127127
aria-label="Room info"
128-
aria-labelledby="test-id-15"
128+
aria-labelledby="test-id-6"
129129
class="_icon-button_1215g_8"
130130
data-kind="primary"
131131
role="button"

0 commit comments

Comments
 (0)