Skip to content

fix(recording): support long room tokens for uploads#18491

Open
pollychen-lab wants to merge 2 commits into
nextcloud:mainfrom
pollychen-lab:fix/issue-18458-recording-upload-key-length
Open

fix(recording): support long room tokens for uploads#18491
pollychen-lab wants to merge 2 commits into
nextcloud:mainfrom
pollychen-lab:fix/issue-18458-recording-upload-key-length

Conversation

@pollychen-lab

Copy link
Copy Markdown

Summary

Keep recording upload app-config keys within Nextcloud's 64-character limit when a conversation uses a long room token.

Root cause

The upload key combines the recupload/ prefix, room token, separator, and a 40-character SHA-1 filename hash. A maximum-length 30-character room token produces an 81-character key, causing chunked upload setup to fail.

Changes

  • Size the filename hash according to the remaining app-config key space.
  • Preserve the full SHA-1 hash for normal room tokens.
  • Add regression coverage for both the existing short-token case and the maximum 30-character token.

At the maximum token length, the filename hash retains 23 hexadecimal characters (92 bits).

Validation

  • PHP 8.3 syntax checks for both changed files
  • Nextcloud PHP coding-standard check
  • Boundary checks for short and maximum-length room tokens
  • git diff --check

Fixes #18458

Signed-off-by: Polly Labs <pollychen.lab@gmail.com>
@nickvergessen

Copy link
Copy Markdown
Member

Comment thread lib/Service/RecordingService.php Outdated

public const APPCONFIG_PREFIX = 'recording/';
public const APPCONFIG_UPLOAD_PREFIX = 'recupload/';
private const APPCONFIG_KEY_MAX_LENGTH = 64;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
private const APPCONFIG_KEY_MAX_LENGTH = 64;
public const APPCONFIG_KEY_MAX_LENGTH = 64;

Signed-off-by: Polly Labs <pollychen.lab@gmail.com>
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.

Recording chunked upload would fail with token length > 13

2 participants