Skip to content

Fix PMP ID handling and generation#583

Merged
7w1 merged 1 commit intoSableClient:devfrom
dozro:fix/582
Mar 29, 2026
Merged

Fix PMP ID handling and generation#583
7w1 merged 1 commit intoSableClient:devfrom
dozro:fix/582

Conversation

@dozro
Copy link
Copy Markdown
Member

@dozro dozro commented Mar 29, 2026

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

  • 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).

No AI was used for this PR

@dozro dozro requested review from 7w1 and hazre as code owners March 29, 2026 01:33
@7w1 7w1 added this pull request to the merge queue Mar 29, 2026
Merged via the queue into SableClient:dev with commit fcff9ef Mar 29, 2026
9 checks passed
@dozro dozro deleted the fix/582 branch March 29, 2026 11:07
github-merge-queue bot pushed a commit that referenced this pull request Mar 30, 2026
> [!IMPORTANT]
> Merging this PR will create a new release.

## Fixes

* Add youtube shorts support to stop it from crashing sable.
([#578](#578) by @nushea)
* Fix rich-text reply previews and custom-formatted messages so unsafe
HTML is filtered more strictly and Matrix colors render correctly.
([#571](#571) by @hazre)
* Fix crash when previewing non-video YouTube URLs (channels, @Handles,
etc.) that lack query parameters.
([#584](#584) by @Just-Insane)
* fix id handling and id generation for Personas
([#583](#583) by @dozro)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/usepmp command no longer accepts profile IDs with non-alphanumeric characters (including the default UUIDs generated when creating a persona)

2 participants