Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview build 1 #2767

Draft
wants to merge 9 commits into
base: livekit
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/config_netlify_preview.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
},
"rageshake": {
"submit_url": "https://element.io/bugreports/submit"
},
"matrix_rtc_session": {
"membership_keep_alive_period": 5000,
"membership_server_side_expiry_timeout": 15000
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"livekit-client": "^2.5.7",
"lodash": "^4.17.21",
"loglevel": "^1.9.1",
"matrix-js-sdk": "matrix-org/matrix-js-sdk#8e9a04cdec0f88fc876bbbf406db55b0677f005d",
"matrix-js-sdk": "matrix-org/matrix-js-sdk#8e65c13d5019eb215fa99c86ddef463d9c383115",
"matrix-widget-api": "^1.10.0",
"normalize.css": "^8.0.1",
"observable-hooks": "^4.2.3",
Expand Down
4 changes: 3 additions & 1 deletion src/button/ReactionToggleButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

.reactionPopupMenuModal > div > div {
padding-inline: var(--cpd-space-6x) !important;
padding-block: var(--cpd-space-6x) var(--cpd-space-8x) !important;
padding-block: var(--cpd-space-6x) var(--cpd-space-6x) !important;
}

.reactionPopupMenu menu {
Expand Down Expand Up @@ -44,6 +44,7 @@
width: 1.4em;
height: 1.4em;
border-radius: var(--cpd-radius-pill-effect);
border: none;
}

@media (max-width: 800px) {
Expand All @@ -53,6 +54,7 @@
width: 1em;
height: 1em;
min-block-size: unset;
border: none;
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/useReactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ export const ReactionsProvider = ({
// This effect handles any *live* reaction/redactions in the room.
useEffect(() => {
const reactionTimeouts = new Set<number>();
// TODO: this should be somewhere more sensible
const handleTimelineReset = (): void => {
logger.warn("Received TimelineReset indicating limited sync response");
};
const handleReactionEvent = (event: MatrixEvent): void => {
// Decrypted events might come from a different room
if (event.getRoomId() !== room.roomId) return;
Expand Down Expand Up @@ -297,6 +301,7 @@ export const ReactionsProvider = ({
}
};

room.on(MatrixRoomEvent.TimelineReset, handleTimelineReset);
room.on(MatrixRoomEvent.Timeline, handleReactionEvent);
room.on(MatrixRoomEvent.Redaction, handleReactionEvent);
room.client.on(MatrixEventEvent.Decrypted, handleReactionEvent);
Expand All @@ -306,6 +311,7 @@ export const ReactionsProvider = ({
room.on(MatrixRoomEvent.LocalEchoUpdated, handleReactionEvent);

return (): void => {
room.off(MatrixRoomEvent.TimelineReset, handleTimelineReset);
room.off(MatrixRoomEvent.Timeline, handleReactionEvent);
room.off(MatrixRoomEvent.Redaction, handleReactionEvent);
room.client.off(MatrixEventEvent.Decrypted, handleReactionEvent);
Expand Down
16 changes: 15 additions & 1 deletion src/utils/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { IndexedDBStore } from "matrix-js-sdk/src/store/indexeddb";
import { MemoryStore } from "matrix-js-sdk/src/store/memory";
import {
createClient,
Filter,
ICreateClientOpts,
Preset,
Visibility,
Expand Down Expand Up @@ -165,7 +166,20 @@ export async function initClient(
// Otherwise, a sync may complete before the listener gets applied,
// and we will miss it.
const syncPromise = waitForSync(client);
await client.startClient({ clientWellKnownPollPeriod: 60 * 10 });
await client.startClient({
clientWellKnownPollPeriod: 60 * 10,
// ask for a high limit to try and avoid gappy syncs
filter: Filter.fromJson(undefined, "element-call", {
room: {
timeline: {
limit: 1000,
},
},
}),
// we ask for 20 past message to try and get some recent context
// n.b. past reactions are not guaranteed to be visible
initialSyncLimit: 20,
});
await syncPromise;

return client;
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6017,9 +6017,9 @@ matrix-events-sdk@0.0.1:
resolved "https://registry.yarnpkg.com/matrix-events-sdk/-/matrix-events-sdk-0.0.1.tgz#c8c38911e2cb29023b0bbac8d6f32e0de2c957dd"
integrity sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==

matrix-js-sdk@matrix-org/matrix-js-sdk#8e9a04cdec0f88fc876bbbf406db55b0677f005d:
version "34.10.0"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/8e9a04cdec0f88fc876bbbf406db55b0677f005d"
matrix-js-sdk@matrix-org/matrix-js-sdk#8e65c13d5019eb215fa99c86ddef463d9c383115:
version "34.11.1"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/8e65c13d5019eb215fa99c86ddef463d9c383115"
dependencies:
"@babel/runtime" "^7.12.5"
"@matrix-org/matrix-sdk-crypto-wasm" "^9.0.0"
Expand Down