-
Notifications
You must be signed in to change notification settings - Fork 10
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
Improve boot time by implementing sliding sync #2290
base: main
Are you sure you want to change the base?
Conversation
packages/host/app/components/ai-assistant/past-session-item.gts
Outdated
Show resolved
Hide resolved
get loadingMoreAIRooms() { | ||
return this.isLoadingMoreAIRooms; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just make the member public. This getter doesn't add anything and the naming is confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed the field and getter since We don't want the value of the field can be updated from outside this class.
lists.set(SLIDING_SYNC_AI_ROOM_LIST_NAME, { | ||
ranges: [[0, SLIDING_SYNC_LIST_RANGE_END]], | ||
filters: { | ||
is_dm: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this is adequate, since we only have AI rooms and Auth rooms, but generally we have been considering a room an AI room if the aibot it one if it's members. Is it possible to use that criteria here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the filter options are very limited, as you can see here. We could use the room_types filter if we defined the room type during room creation, but we don't.
} | ||
|
||
private loadMoreAIRoomsTask = restartableTask(async () => { | ||
if (!this.slidingSync) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a circumstance where this can happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to throw an error
In this PR, I implemented sliding sync to improve boot time. The latest released version of
matrix-js-sdk
does not yet support thesimplified_msc3575
endpoint, so I had to patch the SDK. The PR to add support forsimplified_msc3575
inmatrix-js-sdk
was merged two days ago, so we can update the SDK version once it is released.The implementation introduces two sliding sync lists:
Initially, we only request one timeline event and will load all timeline events when the room is opened. The range for AI rooms increases when a user opens the past session list, and the range for authentication rooms increases when there is an update to the realms state event in account data.
I haven't yet refactored to introduce separate
RoomResource
andRoomStateResource
components, as we discussed, @lukemelia. If needed, we can create a ticket for that.I've tested this in staging, and it improves the AI panel's loading speed.