- Clear initialScrollTimerRef when room changes to prevent stale timer
from firing in a new room after navigation (RoomTimeline.tsx)
- Scope URL preview cache by MatrixClient to prevent cross-account
deduplication when multiple clients/sessions exist (UrlPreviewCard.tsx)
- Delete cache entries after promise settles (both success/rejection)
to prevent unbounded cache growth over long sessions (UrlPreviewCard.tsx)
- Fix pagination token direction check: use appropriate timeline end
and token direction based on pagination direction (forward/backward)
instead of always checking first timeline's backward token
(useTimelineSync.ts)
RoomTimeline.tsx:
- Add liveTimelineLinked guard to the initial-scroll useLayoutEffect.
Without this, a render with stale data from the previous room (before
the room-change reset propagates) fires scrollToIndex at the wrong
index and marks hasInitialScrolledRef = true, blocking the correct scroll
when the right data arrives.
- Add pendingReadyRef to defer setIsReady(true) when the 80 ms timer fires
but processedEvents is empty (e.g. the onLifecycle reset cleared the
timeline within the window). A recovery useLayoutEffect watches for
processedEvents.length becoming non-empty and performs the final scroll +
setIsReady when the flag is set. Previously setIsReady(true) was called
unconditionally from the timer, revealing the room at position 0 when
events had not yet arrived.
- Reset pendingReadyRef on room change so dangling recovery state from a
previous room cannot fire in the new room context.
useTimelineSync.ts:
- After await paginateEventTimeline, re-read from timelineRef.current
instead of using the pre-await lTimelines capture. A sliding sync reset
(resetLiveTimeline) during pagination replaces lTimelines[0] with a new
EventTimeline object; the stale reference causes getLinkedTimelines to
traverse the wrong chain, making countAfter/countBefore comparisons wrong
and triggering incorrect pagination decisions.
- Add room-change useEffect that resets the timeline state to the new room's
initial linked timelines when room.roomId changes. Without this, the
component retains stale data from the previous room, keeping
liveTimelineLinked false until a TimelineReset event fires -- which may
never happen for revisited rooms where the sliding sync response does not
include initial:true.
### Description
Replace the previous hacky regex method with a slightly better link
parser. Add support for timestamps, playlists and youtube music links,
tracking info is still stripped and embeds use the timestamp. Previously
none of these features were supported, this might also be slightly more
robust.
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [ ] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [X] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
### Description
not setting `sender` to `null` anymore but just not setting it.
Fixes#539 (hopefully)
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
no AI was used for this PR
The Matrix SDK for sliding sync deliberately does not call resetLiveTimeline()
on limited:true (the handling is in a commented-out TODO block). This means
events from a previous visit remain in the live timeline and new events get
appended after them, with the backward pagination token pointing to the gap
between old and new events rather than to before all events. The result is
that new messages appear out of order or the gap is unreachable via the UI.
Two fixes:
1. useSlidingSyncActiveRoom: reset the live timeline synchronously before
the subscription request is sent on room navigation. This ensures the
fresh initial:true response populates a clean timeline, not one polluted
with events from the previous visit. Also removes the 100ms delay that
was added as an incomplete workaround for the same issue.
2. SlidingSyncManager.onLifecycle: in RequestFinished state (fires before
any room data listeners run), reset the live timeline for active-room
subscriptions that receive initial:true or limited:true. This covers the
reconnect/background case where the pos token expires and all active rooms
get a fresh initial:true in the same sync cycle.
### Description
Extends `scrubMatrixUrl` with two additional patterns that were leaking
through the existing scrubber.
**1. Opaque Matrix IDs with percent-encoded colon (`%3A`)**
Device IDs, filter tokens, and other Matrix IDs that lack a sigil prefix
but follow the `localpart%3Aserver` pattern were not matched by the
existing sigil-based patterns. For example:
```
/Gj3Wy2D8gAi8jTIyR%3Asable.moe → /[MATRIX_ID]
```
**2. Long opaque base64url path segments**
Access tokens, Curve25519 keys, MSC3575 session tokens, and push
endpoints appear as 30+ character base64url strings in URL path
segments. These were passing through unscrubbed. For example:
```
/vI02CuiDNpaYEhUIVLbqE8vdKqm2ZwqIR5Y6NwNY_Rg/ → /[REDACTED]/
```
The new pattern runs last so the earlier sigil-based patterns already
handle known Matrix IDs first.
Fixes #
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted
- [x] Fully AI generated
Two regex patterns added to `scrubMatrixUrl` in `sentryScrubbers.ts`.
The first matches path segments containing a bare `localpart%3Aserver`
form (no sigil) and replaces with `[MATRIX_ID]`. The second matches any
path segment of 30 or more base64url characters and replaces with
`[REDACTED]`, covering access tokens, crypto keys, and opaque session
identifiers. Both are appended after the existing patterns so known
sigil-prefixed IDs are handled first.
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
This fixes unread badge positioning by deriving sidebar badge layout
from the same settings-aware mode that decides whether unread badges
render as dots or counts, so toggling badge display no longer leaves the
offset wrong. It also includes the related unread count formatting
cleanup, an Appearance toggle for large-count badge behavior, and
replaces `millify` dependency with a shared `Intl.NumberFormat` compact
formatter.
### Screenshots
<img width="68" height="463" alt="image"
src="https://github.com/user-attachments/assets/89f19c25-f6aa-46c2-8172-9748f43f605d"
/>
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [x] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
<!-- Please read
https://github.com/ajbura/cinny/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->
Adds a black theme (high contrast dark theme)
I used
https://github.com/7w1/sable/pull/51/changes/6f2d63046a57908b7d5d8c21c6eefe3dff160e43
as a reference of how to do this.
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### Description
Adds cross-device settings sync by storing Sable's app settings in a
Matrix account data event (`moe.sable.app.settings`). Change a setting
on one device and it propagates to your other sessions automatically.
Fixes #
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [x] Fully AI generated (explain what all the generated code does in
moderate detail).
**What the generated code does:**
`settingsSync.ts` — Serialise/deserialise helpers that convert the
settings state to/from the account data wire format. Unknown keys are
preserved so older clients don't silently drop data from newer ones.
`useSettingsSync.ts` — The main sync hook. On mount it reads any
existing account data and merges it into local state. It then listens
for live updates from other devices via `ClientEvent.AccountData`.
Uploads are debounced by 2 seconds and each one embeds a random
`synctoken`; when the server echoes the event back, the hook recognises
its own token and skips re-applying it. Exposes `settingsSyncStatusAtom`
and `settingsSyncLastSyncedAtom` for UI feedback.
`General.tsx` — Adds a "Sync settings across devices" toggle and a JSON
export/import section for manually backing up and restoring settings.
`ClientNonUIFeatures.tsx` — Mounts the sync hook once at the client root
so it stays active for the whole session.
`settings.ts` — Adds `settingsSyncEnabled: boolean` (default `false`) to
the settings atom.
Type files — Registers `moe.sable.app.settings` in the account data type
registry so SDK callbacks are typed correctly.
Tests cover the serialise/deserialise helpers, load-on-mount, merge
behaviour, echo-loop skipping, debounced uploads, and error states.
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->
Hopefully should help us actually figure out why many people seemingly
can't forward messages.
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
Multiple UrlPreviewCard instances rendering simultaneously (e.g. after
a large event batch loads) each called mx.getUrlPreview(url, ts). The
SDK caches by bucketed-timestamp + URL, so identical URLs from different
messages produced N separate HTTP requests.
Add a module-level previewRequestCache (Map<url, Promise>) that dedups
in-flight requests across all instances. Resolved promises remain cached
for the session; rejected ones are evicted so later renders can retry.
## 1. useTimelinePagination: finally-block resets fetchingRef prematurely
When a paginated page returns 1–4 events and more history exists, the
paginator fires a recursive continuation call (`paginate(backwards)`)
before the outer `finally` block runs. The sequence was:
1. outer try: `fetchingRef.current[dir] = false; paginate(backwards);`
→ inner paginate runs synchronously:
checks lock (false) → sets it to `true` → hits `await` → suspends
2. outer finally: `fetchingRef.current[dir] = false;`
→ overwrites the `true` that inner paginate just wrote
This left `fetchingRef.current[dir] = false` while the inner paginate
was mid-flight. The `backwardStatus === 'loading'` guard on the scroll
handler masked the problem in most cases, but for a long chain of sparse
pages each returning 1–4 events, multiple overlapping paginations could
start. If the SDK's internal per-timeline lock was also released (or a
forward-direction call raced), events could be requested from stale
pagination tokens and be inserted out of order.
Fix: add a `continuing` local boolean. When a recursive continuation is
fired, `continuing = true` is set first. The `finally` block skips the
reset when `continuing` is true, leaving the lock in the inner paginate's
hands. The inner paginate's own `finally` releases it when it finishes.
## 2. getLinkedTimelines: O(N²) array copies in recursive accumulator
The previous recursive `collectTimelines(tl, dir, [...acc, tl])` created
N intermediate arrays for an N-timeline chain (sizes 1, 2, 3, … N),
giving O(N²) total allocations. For a power user who paginates back
through hundreds of pages of history, this becomes measurable GC pressure.
Replace with a simple iterative loop (`while (current) { push; next }`)
that builds exactly one output array in O(N) time.
### Description
added a regex to the rendering of messages to detect jumbo emojis. the
regex used is:
```
^(<img[^>]*data-mx-emoticon[^>]*\/>){1,20}$
```
Fixes https://github.com/SableClient/Sable/issues/458
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
no AI was used in the creation of this PR
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
The service worker (SW) loses its in-memory session on restart (e.g.
after the browser kills the SW background process). Any authenticated
media request arriving before the SW re-reads session data from cache
was returning a 401.
Two fixes:
1. **Eager pre-load on `activate`**: the SW now reads session data from
the cache during the `activate` event, so it is available immediately
when the first `fetch` event fires.
2. **Graceful fallback in fetch handler**: if session data is still
missing or stale at request time, the request is passed through to the
network without injecting a bad `Authorization` header (previously an
empty/invalid token was injected, causing the 401).
Fixes #
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [X] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
Attempts to resolve issues with the service worker not properly storing
and/or refreshing media auth tokens on load. The changes mainly serve to
ensure that a session is persisted during restarts (and then drop the
persisted session once a live one is available). Also helps with
refreshing tokens (`sw.ts` ln 651-661)
### Description
fixes falling back to your non-pmp sender info when sending a sticker or
a attachment
Fixes https://github.com/SableClient/Sable/issues/513
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
No ai was used for this PR
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
This adds the keybinds `ctrl+up`/`ctrl+down` to be used to cycle what
message you are replying to. This is inspired by [the vencord plugin
QuickReply](https://vencord.dev/plugins/QuickReply)
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
I couldn't get `pnpm dev ` to run so I used an llm to help me figure
that out so I could test my changes, but no code in this pr has been
touched by an llm
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
The "Known issues" link in the Experimental Settings page for Sliding
Sync pointed to the old repository (`7w1/sable#146`). This updates it to
the correct issue in the current repository.
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [x] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
AI was used to locate the old link in the codebase. The change itself is
a one-line URL update in `General.tsx` — no logic is involved.
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
Following the spec there needs to be a way to send (as there is a "way"
to display already) location messages.
This PR adds 2 commands one could use for that purpose (in preparation
of maybe adding a location sharing button in the future)
/location [Latitude] [Longitude] [Altitude?] ← for sending any arbitrary
location with its coords
/sharemylocation ← for sharing one's current location using the gps
tracker inside all phones nowadays :3
#### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
I had to set up a proper self host to test this little thing because my
laptop doesnt have a tracker :3 so i had to use my phone
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
<!-- Please include a summary of the change. Please also include
relevant motivation and context. List any dependencies that are required
for this change. -->
Fixes#510
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->