Skip to content

Refactor codebase and standardize unstable prefix usage#746

Merged
7w1 merged 2 commits into
devfrom
cleanup/unstable-prefix-orga
May 5, 2026
Merged

Refactor codebase and standardize unstable prefix usage#746
7w1 merged 2 commits into
devfrom
cleanup/unstable-prefix-orga

Conversation

@dozro
Copy link
Copy Markdown
Member

@dozro dozro commented May 5, 2026

Description

This pull request standardizes the usage of Matrix event content keys by replacing hardcoded property names and older constants with centralized, unstable prefix constants imported from the $unstable/prefixes module. This change improves maintainability and consistency across the codebase, especially in handling experimental or non-standard Matrix properties.

The most important changes are as follows:

Prefix Standardization and Centralization

Replaced all hardcoded Matrix property names and older constants (e.g., 'com.beeper.per_message_profile', 'com.beeper.linkpreviews', etc.) with corresponding constants from the $unstable/prefixes module throughout the codebase, including message rendering, room creation, user profiles, and input handling.

Message Content Handling

Updated all logic for reading, writing, and deleting Matrix event content properties (e.g., per-message profiles, link previews, image source packs, spoilers, blur hashes, forward metadata) to use the new prefix constants, ensuring consistent access and mutation of event content.

User Profile and Room Metadata

Updated user profile extended keys (such as bio, banner, pronouns, timezone, animal identity) in UserRoomProfile.tsx to use the new prefix constants, replacing all previous hardcoded or legacy key strings.

Room Creation and Calls

Changed the room call state event type to use the new unstable prefix constant in room creation utilities.

Code Clean-up

Removed now-unused imports of old constants from files where they have been replaced with the new prefix-based constants.

These changes collectively improve the code's future compatibility with evolving Matrix specifications and make it easier to update property names as they stabilize.

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

Shouldn't cause user facing changes

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:

No AI usage

@dozro dozro added the internal label May 5, 2026
@dozro dozro force-pushed the cleanup/unstable-prefix-orga branch 3 times, most recently from 5b50271 to 58e140b Compare May 5, 2026 16:18
@dozro dozro force-pushed the cleanup/unstable-prefix-orga branch from 58e140b to e685877 Compare May 5, 2026 16:21
@dozro dozro marked this pull request as ready for review May 5, 2026 16:23
@dozro dozro requested review from 7w1 and hazre as code owners May 5, 2026 16:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-746-sable.raspy-dream-bb1d.workers.dev e685877 pr-746 Tue, 05 May 2026 16:23:54 GMT

Copy link
Copy Markdown
Member

@7w1 7w1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay

@7w1 7w1 merged commit 34fbfda into dev May 5, 2026
12 checks passed
@7w1 7w1 deleted the cleanup/unstable-prefix-orga branch May 5, 2026 20:26
@7w1 7w1 mentioned this pull request May 5, 2026
11 tasks
7w1 added a commit that referenced this pull request May 5, 2026
<!-- 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 the has_cats key that was set to has_cat in #746 

#### 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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants