A switch for sliding sync, and a warning under it

The window half of #190. A toggle in the Matrix account tools, off unless
somebody turns it on, saying what it does and what to do if it goes wrong -
"if this account stops receiving messages, turn it back off" - because that
is the failure mode and it should not have to be guessed at.

Reconnecting the account is what picks the change up, since which sync to
speak is decided once per connection, and the toast says so rather than
leaving somebody watching an unchanged window.

Closes #190.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
2026-09-12 10:04:21 -04:00
co-authored by Claude Opus 5
parent 29b1022323
commit 0517d0f750
3 changed files with 35 additions and 1 deletions
+1 -1
Submodule nobilis updated: e8cba7cae2...2505f58e15
@@ -115,6 +115,34 @@ export function MatrixAccountTools({ account }: { account: Account }): JSX.Eleme
return (
<div className="matrix-tools">
<div className="setting-row">
<div className="setting-text">
<div>Sliding sync</div>
<div className="small muted">
A newer, much lighter way of talking to the homeserver: it sends the rooms that
changed instead of the whole account every time. Worth it on an account in a lot of
rooms. Still new here — if this account stops receiving messages, turn it back off.
</div>
</div>
<button
type="button"
className={account.slidingSync ? 'button' : 'button subtle'}
onClick={() =>
void rpc('setMatrixSlidingSync', { accountId: account.id, enabled: !account.slidingSync })
.then(() =>
store.toast(
'info',
account.slidingSync
? 'Sliding sync off — reconnect this account to go back to the old sync'
: 'Sliding sync on — reconnect this account to start using it'
)
)
.then(() => void store.refreshAccounts())
}
>
{account.slidingSync ? 'On' : 'Off'}
</button>
</div>
<div className="setting-row">
<div className="setting-text">
<div>Call server</div>
+6
View File
@@ -55,6 +55,12 @@ export interface Account {
* homeservers do name one.
*/
rtcFocusUrl?: string
/**
* Matrix only: whether this account uses sliding sync where the homeserver
* offers it. Off unless somebody turned it on - it replaces the whole of how
* the account talks to its server, so it is not taken automatically.
*/
slidingSync?: boolean
}
export interface SneedChatRoom {