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)
<!-- 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. -->
Should fix the last of the bugs with per-message profile rendering in
encrypted rooms.
Ensures that pmp's are always updated on decryption and gets the
timeline to refresh whenever pmps are unencrypted to make sure they get
grouped together properly.
Vibes are telling me this isn't the best way to do this for some reason,
but it does seem to be working and I can't think of any other method
that doesn't involve creating a billion more event listeners in other
files.
#### 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).
<!-- 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. -->
### 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
### Description
moved language pronoun filter setting to Appearance (not really much
more to say)
Fixes#520
#### 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
only a ui change, neither a fix nor a new feature
### 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).
<!-- 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 in the creation of this PR
<!-- 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. -->
On SW restart the in-memory sessions Map is empty. Previously the fetch
handler fell through to requestSessionWithTimeout (3 s race window), so
all simultaneous thumbnail loads during that window 401'd.
Changes:
- Populate preloadedSession from Cache Storage in the activate handler
so media fetches get immediate auth before the first live setSession
arrives from the page.
- Include preloadedSession in the byBaseUrl fast path so the synchronous
branch handles the burst of thumbnail requests without waiting at all.
- Clear preloadedSession as soon as any real setSession arrives so stale
tokens cannot linger.
- Handle empty clientId (uncontrolled-context fetches) by falling through
to byBaseUrl / preloadedSession / loadPersistedSession instead of doing
a bare return that bypassed respondWith and caused an unauthenticated
request.
Three changes to src/sw.ts:
1. Fix early-return bug in fetch handler: when sessions.get(clientId)
returns a session but validMediaRequest(url, session.baseUrl) fails
(e.g. multi-account users on different homeservers, or URL format
mismatch), the old code returned without calling event.respondWith(),
causing the browser to make an unauthenticated request → 401.
Now we only short-circuit if BOTH conditions are met.
2. Proactively broadcast requestSession to all window clients in the
activate event. After a SW restart the sessions Map is empty; the
old code relied on the first intercepted media fetch to trigger
requestSessionWithTimeout. Now the SW pre-populates the Map right
after claiming clients, eliminating the 3-second race window.
3. Add loadPersistedSession() as a final fallback in the fetch handler.
If requestSessionWithTimeout returns nothing (
Three changes to src/sw.ts:
1. Fix early-return bug in fetch handler: when sessions.get(clientId)
returns a session buo a
1. Fix early-return bug i
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
This PR seeks to fix the issues around the autocomplete for emoji, room,
command, and people.
The issues fixed by this PR are: the autocomplete menu not scrolling,
not rollovering (ie when you were at the top you couldnt go back to the
bottom or vice versa), and when editing a message and trying to select
an emoji the arrow buttons not working.
#### 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:
- [ ] 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. -->
Written with all the natural stupidity possible in one so-called human
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
This PR wants to cap the height of an event to prevent one single event
taking the entire screensize.
(before the PR)
<img width="1331" height="867" alt="image"
src="https://github.com/user-attachments/assets/b299cacd-85ff-4496-ac28-174c9f511faa"
/>
(after the PR)
<img width="1321" height="769" alt="image"
src="https://github.com/user-attachments/assets/abbdcab2-b375-4572-909c-d59ff6e294b5"
/>
Fixes #
#### Type of change
prevents
- [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:
- [ ] 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/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 #
#### 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. -->
> [!IMPORTANT]
> Merging this PR will create a new release.
## Fixes
* Change cloudflare deploy worker message to something much shorter to
avoid char limit. ([#504](https://github.com/SableClient/Sable/pull/504)
by @7w1)
<!-- 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 #
#### 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. -->