Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Experimental SSS #36

Closed
wants to merge 12 commits into from
7 changes: 7 additions & 0 deletions src/MatrixClientPeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import PlatformPeg from "./PlatformPeg";
import { formatList } from "./utils/FormattingUtils";
import SdkConfig from "./SdkConfig";
import { Features } from "./settings/Settings";
import SlidingSyncController from "./settings/controllers/SlidingSyncController";

export interface IMatrixClientCreds {
homeserverUrl: string;
Expand Down Expand Up @@ -298,10 +299,16 @@ class MatrixClientPegClass implements IMatrixClientPeg {
opts.clientWellKnownPollPeriod = 2 * 60 * 60; // 2 hours
opts.threadSupport = true;

/* TODO: Uncomment before PR lands
if (SettingsStore.getValue("feature_sliding_sync")) {
opts.slidingSync = await SlidingSyncManager.instance.setup(this.matrixClient);
} else {
SlidingSyncManager.instance.checkSupport(this.matrixClient);
} */
// TODO: remove before PR lands. Defaults to SSS if the server entered supports it.
await SlidingSyncManager.instance.checkSupport(this.matrixClient);
if (SlidingSyncController.serverSupportsSlidingSync) {
opts.slidingSync = await SlidingSyncManager.instance.setup(this.matrixClient);
}

// Connect the matrix client to the dispatcher and setting handlers
Expand Down
381 changes: 164 additions & 217 deletions src/SlidingSyncManager.ts

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/components/structures/TimelinePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ class TimelinePanel extends React.Component<IProps, IState> {
) {
return;
}

if (!Thread.hasServerSideSupport && this.context.timelineRenderingType === TimelineRenderingType.Thread) {
if (toStartOfTimeline && !this.state.canBackPaginate) {
this.setState({
Expand Down Expand Up @@ -1542,7 +1541,6 @@ class TimelinePanel extends React.Component<IProps, IState> {

const onLoaded = (): void => {
if (this.unmounted) return;

// clear the timeline min-height when (re)loading the timeline
this.messagePanel.current?.onTimelineReset();
this.reloadEvents();
Expand Down Expand Up @@ -1644,7 +1642,6 @@ class TimelinePanel extends React.Component<IProps, IState> {
onLoaded();
return;
}

const prom = this.timelineWindow.load(eventId, INITIAL_SIZE).then(async (): Promise<void> => {
if (this.overlayTimelineWindow) {
// TODO: use timestampToEvent to load the overlay timeline
Expand Down
6 changes: 0 additions & 6 deletions src/components/views/rooms/RoomSublist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ export default class RoomSublist extends React.Component<IProps, IState> {
};

private onShowAllClick = async (): Promise<void> => {
if (this.slidingSyncMode) {
const count = RoomListStore.instance.getCount(this.props.tagId);
await SlidingSyncManager.instance.ensureListRegistered(this.props.tagId, {
ranges: [[0, count]],
});
}
// read number of visible tiles before we mutate it
const numVisibleTiles = this.numVisibleTiles;
const newHeight = this.layout.tilesToPixelsWithPadding(this.numTiles, this.padding);
Expand Down
82 changes: 0 additions & 82 deletions src/hooks/useSlidingSyncRoomSearch.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@
"render_reaction_images_description": "Sometimes referred to as \"custom emojis\".",
"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.",
"sliding_sync": "Sliding Sync mode",
"sliding_sync": "Simplified Sliding Sync mode",
"sliding_sync_description": "Under active development, cannot be disabled.",
"sliding_sync_disabled_notice": "Log out and back in to disable",
"sliding_sync_server_no_support": "Your server lacks support",
Expand Down
5 changes: 0 additions & 5 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import React, { ReactNode } from "react";
import { UNSTABLE_MSC4133_EXTENDED_PROFILES } from "matrix-js-sdk/src/matrix";

Check failure on line 11 in src/settings/Settings.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

Module '"matrix-js-sdk/src/matrix"' has no exported member 'UNSTABLE_MSC4133_EXTENDED_PROFILES'.

import { _t, _td, TranslationKey } from "../languageHandler";
import {
Expand Down Expand Up @@ -389,11 +389,6 @@
default: false,
controller: new SlidingSyncController(),
},
"feature_sliding_sync_proxy_url": {
// This is not a distinct feature, it is a legacy setting for feature_sliding_sync above
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS_WITH_CONFIG,
default: "",
},
"feature_element_call_video_rooms": {
isFeature: true,
labsGroup: LabGroup.VoiceAndVideo,
Expand Down
14 changes: 3 additions & 11 deletions src/stores/room-list/RoomListStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { VisibilityProvider } from "./filters/VisibilityProvider";
import { SpaceWatcher } from "./SpaceWatcher";
import { IRoomTimelineActionPayload } from "../../actions/MatrixActionCreators";
import { RoomListStore as Interface, RoomListStoreEvent } from "./Interface";
import { SlidingRoomListStoreClass } from "./SlidingRoomListStore";
import { UPDATE_EVENT } from "../AsyncStore";
import { SdkContextClass } from "../../contexts/SDKContext";
import { getChangedOverrideRoomMutePushRules } from "./utils/roomMute";
Expand Down Expand Up @@ -640,16 +639,9 @@ export default class RoomListStore {

public static get instance(): Interface {
if (!RoomListStore.internalInstance) {
if (SettingsStore.getValue("feature_sliding_sync")) {
logger.info("using SlidingRoomListStoreClass");
const instance = new SlidingRoomListStoreClass(defaultDispatcher, SdkContextClass.instance);
instance.start();
RoomListStore.internalInstance = instance;
} else {
const instance = new RoomListStoreClass(defaultDispatcher);
instance.start();
RoomListStore.internalInstance = instance;
}
const instance = new RoomListStoreClass(defaultDispatcher);
instance.start();
RoomListStore.internalInstance = instance;
}

return this.internalInstance;
Expand Down
Loading
Loading