### Description
This pull request addresses issues with ID handling and generation for
Personas by standardizing the way short IDs are generated and used
throughout the codebase. It replaces the use of `crypto.randomUUID()`
with a new utility function, `generateShortId`, ensuring IDs are shorter
and more consistent. Additionally, it improves command parsing for
Persona-related commands.
#### ID Generation Improvements
- Introduced a new utility function `generateShortId` in
`src/app/utils/shortIdGen.ts` to generate short, consistent IDs by
truncating UUIDs.
- Replaced all instances of `crypto.randomUUID()` with
`generateShortId(5)` when creating new Persona or member IDs in
`PerMessageProfileOverview.tsx` and `PKitCommandMessageHandler.ts`,
ensuring all IDs are now short and uniform.
#### Command Parsing Enhancements
- Updated regular expressions in `useCommands.ts` to use `\S+` instead
of `\w+` for Persona IDs, allowing IDs with a broader set of characters
and improving robustness of command parsing.
Fixes#582
#### 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. -->
No AI was used for this PR
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
Added basic shorts support and a fallback to fix it from crashing on
shorts.
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
- [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. -->
Athena has cursed me with the wisdom to fix this.
### Description
Fixes profile and avatar loading regressions introduced around the
MSC4440 bio compatibility work.
This PR addresses two related problems:
- Own profile data could disappear when `useUserProfile` encountered
`gay.fomx.biography` in an unexpected shape or when the field was
missing entirely.
- Avatar components could get stuck in fallback mode after a transient
image load failure, causing the account avatar and other avatars to
disappear until a full reload.
The fix does three things:
- parses `gay.fomx.biography` defensively with optional access instead
of assuming `m.text[0].body` always exists
- retries profile fetches when the cache was previously poisoned into an
`_fetched`-only state after normalization failed
- resets avatar error state when the image `src` changes so transient
media/auth failures can recover on later renders
This was verified against the broken Account settings / account switcher
behavior where avatar, banner, bio, status, and pronouns could appear
missing.
Fixup of #559
#### 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 (GitHub Copilot)
`useUserProfile.ts`: Hardened MSC4440 bio parsing so missing or
malformed `gay.fomx.biography` data does not throw during normalization,
and allowed refetching when the profile cache only contains `_fetched:
true` from a prior failed normalization.
`UserAvatar.tsx` and `RoomAvatar.tsx`: Reset local image error state
when `src` changes so a temporary image load failure does not
permanently lock the component into fallback rendering.
<!-- Please read
https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before
submitting your pull request -->
### Description
This is a quick and dirty fix to youtube links not having parameters
**This fixes a branch issue**
#### 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. -->
I have asked God for the solution
### Description
Fixes several timeline bugs introduced after the
timeline-reset-on-navigation refactor:
- Scroll-to-bottom no longer gets stuck after navigating to a room
- Timeline pagination no longer uses a stale timeline chain after a
sliding sync reset
- URL preview requests are deduplicated so the same URL only fires one
network request
- Removed a redundant spidering call that was generating an extra
sliding sync request per room visit
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
- [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:
- [x] Partially AI assisted (GitHub Copilot)
`RoomTimeline.tsx`: Added a `liveTimelineLinked` guard so the initial
scroll doesn't fire with stale data from the previous room, and a
`pendingReadyRef` that defers `setIsReady(true)` when `processedEvents`
is still empty (preventing the room opening at position 0).
`useTimelineSync.ts`: A `useEffect` resets the timeline state on room
change so revisited rooms aren't stuck with `liveTimelineLinked =
false`. Reads `linkedTimelines` fresh after each `await` in pagination
so a sliding sync reset mid-paginate doesn't cause count comparisons on
a detached chain. A `continuing` flag prevents two concurrent pagination
calls from racing on the lock. URL preview dedup uses a module-level
`Map` to share in-flight promises for the same URL. Removed a redundant
`startSpidering` subscription call in the sync setup path.
### Description
Fixes#427Fixes#425 (you can use shorthands, instead of `/usepmp`)
#### PluralKit Compatibility and Per-Message Profile Enhancements
- Added limited compatibility for PluralKit-style (`pk;member`)
commands, allowing users to interact with PMPs using familiar PK syntax.
- Introduced shorthand syntax for sending messages with a Persona, such
as `✨:test`, and an option to enable/disable this in settings.
- Added a new settings section (`PKCompatSettings`) in the Persona
profile page to toggle PK command compatibility and shorthand proxying.
#### Command Handling Improvements
- Updated `/addpmp` and `/usepmp` command parsing to use regular
expressions, fixing syntax issues and clarifying usage. The `/usepmp`
command now has a new syntax and properly resets room associations when
requested.
- Added a new `/pmpproxy` command to associate a proxy with a profile,
and integrated feedback for unsupported flags in `/usepmp`.
#### Data Model and Utility Updates
- Expanded the per-message profile data model to support compatibility
versions and proxy associations, including new type definitions and
parsing utilities.
These changes collectively improve the user experience for those using
per-message profiles and PluralKit-style workflows, and provide more
flexible and robust command handling.
#### Type of change
- [x] 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).
no AI was used in the creation of this PR
### Description
Fix reply preview rendering so formatted reply content is sanitized
before React HTML parsing.
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:
- [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).
AI-assisted parts:
- Extracted `sanitizeReplyFormattedPreview()` in `Reply.tsx` so
formatted reply previews are always sanitized before parsing.
- Added regression tests in `ThreadIndicator.test.tsx` for quote
stripping and sanitizer behavior.
- Adjusted the test payload and formatting to satisfy lint and prettier
checks.
- 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
This pull request fixes an issue with forwarding messages for users on
Synapse homeservers by ensuring that relations and mentions are properly
removed from forwarded messages. The changes focus on improving privacy
and preventing confusion when messages are forwarded to other rooms.
#### Forwarding and privacy improvements
- Removed the `m.relates_to` and `m.mentions` fields from the forwarded
message content to avoid leaking relations or mentions from the original
message.
- Removed the addition of a new `m.relates_to` relation when
constructing the forwarded message, preventing references to the
original event in the forwarded message.
Fixes#539
#### 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 in the creation of this PR
### Description
Adds a command called `/html` to send HTML messages.
#### 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).
- [ ] 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
This pull request adds support for saving and reading user bios in the
MSC4440 format, improving compatibility with the MSC4440 specification
for Matrix user profiles. The changes ensure that bios are now stored
and retrieved in both the legacy and MSC4440-compliant formats, and
introduce new types to support this functionality.
#### MSC4440 Bio Compatibility
- User bios are now saved in the MSC4440 format (`gay.fomx.biography`)
in addition to existing formats, ensuring forward compatibility with the
MSC4440 spec. When saving, both HTML and plain text representations are
stored.
- The user profile normalization logic now reads bios from the MSC4440
field first, falling back to legacy fields if necessary.
- The fields handled by the normalization function are updated to
include the MSC4440 bio key.
#### Type and Import Updates
- New types `MSC1767Text` and `MSC4440Bio` are introduced to represent
the MSC4440 bio format, and relevant imports are updated throughout the
codebase.
implements https://github.com/matrix-org/matrix-spec-proposals/pull/4440
#### 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).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
No AI was used in the creation of this PR
### Description
When the pusher is configured with `event_id_only` format, the service
worker fetches event details itself rather than receiving them in the
push payload. Previously only the sender display name and room name were
retrieved — `room_avatar_url` was always `undefined`, so every
notification showed the default app logo regardless of whether the room
or sender had an avatar set. Display names could also be stale in the
encrypted path when the app resumed from a cold state.
**Changes in `src/sw.ts`:**
- `fetchMemberDisplayName` → `fetchMemberInfo`: the same single HTTP
request to `m.room.member` state now also extracts `avatar_url`, giving
both display name and sender avatar for free
- `fetchRoomAvatar`: new helper that fetches the `m.room.avatar` state
event URL
- `mxcToNotificationUrl`: converts `mxc://` to a legacy unauthenticated
thumbnail URL (`/_matrix/media/v3/thumbnail/…`) so the OS can load the
notification icon without an auth header
- `handleMinimalPushPayload`: room avatar is now fetched in the initial
parallel batch alongside the event and room name; icon is resolved as
room avatar → member avatar (DM fallback) → default logo;
`room_avatar_url` passed to all `handlePushNotificationPushData` call
sites
- Encrypted relay path now uses the server-fetched `senderDisplay`
(authoritative) rather than the SDK cache value from the relay, which
can be absent or stale when the app hasn't fully synced after a cold
resume
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
- [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).
- [x] Fully AI generated (explain what all the generated code does in
moderate detail).
`fetchMemberInfo` extends the existing member state fetch to also return
`avatar_url`. `fetchRoomAvatar` GETs `m.room.avatar` state.
`mxcToNotificationUrl` builds a legacy `/_matrix/media/v3/thumbnail/`
URL (no auth required, OS-loadable) from an `mxc://` URI.
`handleMinimalPushPayload` adds `fetchRoomAvatar` to its parallel fetch
batch, resolves the notification icon with room > member > default
priority, and passes it through as `room_avatar_url` to every
`handlePushNotificationPushData` invocation. The encrypted relay path is
updated to prefer the server-fetched display name over the relay's
potentially-stale SDK cache value.
### Description
Add ability to open the user hero by clicking on the usernames shown in
member and state events (e.g. user joins room, room name changed). I
expected this behavior based on previous usage of discord, it wasn't
doing anything previously so I think this is a useful addition.
#### 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).