Skip to content

Commit a2fb60c

Browse files
committed
fix(recording): Reduce config key length for request-upload configs
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 11bbcde commit a2fb60c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/Service/RecordingService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class RecordingService {
5454
public const CONSENT_REQUIRED_OPTIONAL = 2;
5555

5656
public const APPCONFIG_PREFIX = 'recording/';
57-
public const APPCONFIG_UPLOAD_PREFIX = 'recording-upload/';
57+
public const APPCONFIG_UPLOAD_PREFIX = 'recupload/';
5858

5959
public const DEFAULT_ALLOWED_RECORDING_FORMATS = [
6060
'audio/ogg' => ['ogg'],
@@ -315,7 +315,7 @@ private function cleanupUploadShare(Room $room, string $fileName): void {
315315
}
316316

317317
private function getUploadShareConfigKey(Room $room, string $fileName): string {
318-
return self::APPCONFIG_UPLOAD_PREFIX . $room->getToken() . '/' . basename($fileName);
318+
return self::APPCONFIG_UPLOAD_PREFIX . $room->getToken() . '/' . sha1(basename($fileName));
319319
}
320320

321321
/**

tests/php/Service/RecordingServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public function testRequestUpload(): void {
246246

247247
$this->appConfig->expects($this->once())
248248
->method('setAppValueString')
249-
->with(RecordingService::APPCONFIG_UPLOAD_PREFIX . 'token123/recording.mp4', 'shareToken', true, true);
249+
->with(RecordingService::APPCONFIG_UPLOAD_PREFIX . 'token123/' . sha1('recording.mp4'), 'shareToken', true, true);
250250

251251
// The active-recording marker is cleared once the upload share is created,
252252
// so a new recording can start while this one is still being uploaded.
@@ -324,7 +324,7 @@ public function testFinishUpload(): void {
324324
// Only the temporary upload share's tracking value is cleared here; the
325325
// active-recording marker was already removed in requestUpload().
326326
$this->appConfig->expects($this->once())->method('deleteAppValue')
327-
->with(RecordingService::APPCONFIG_UPLOAD_PREFIX . 'token123/name.ogg');
327+
->with(RecordingService::APPCONFIG_UPLOAD_PREFIX . 'token123/' . sha1('name.ogg'));
328328

329329
$this->notificationManager->expects($this->once())->method('notify');
330330

0 commit comments

Comments
 (0)