Skip to content

Commit be5eaca

Browse files
authored
Merge pull request #4819 from LibreSign/fix/optimize-file-loading
fix: optimize file loading
2 parents 545a439 + 14334f5 commit be5eaca

19 files changed

Lines changed: 43 additions & 69 deletions

.github/workflows/behat-mariadb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8686
8787
- name: Install system dependencies
88-
run: sudo apt install poppler-utils
88+
run: sudo apt update && sudo apt install poppler-utils
8989

9090
- name: Checkout server
9191
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/behat-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9090
9191
- name: Install system dependencies
92-
run: sudo apt install poppler-utils
92+
run: sudo apt update && sudo apt install poppler-utils
9393

9494
- name: Checkout server
9595
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/behat-pgsql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8989
9090
- name: Install system dependencies
91-
run: sudo apt install poppler-utils
91+
run: sudo apt update && sudo apt install poppler-utils
9292

9393
- name: Checkout server
9494
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/behat-sqlite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8080
8181
- name: Install system dependencies
82-
run: sudo apt install poppler-utils
82+
run: sudo apt update && sudo apt install poppler-utils
8383

8484
- name: Checkout server
8585
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/phpunit-mariadb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9191
9292
- name: Install system dependencies
93-
run: sudo apt install poppler-utils
93+
run: sudo apt update && sudo apt install poppler-utils
9494

9595
- name: Checkout server
9696
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/phpunit-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9191
9292
- name: Install system dependencies
93-
run: sudo apt install poppler-utils
93+
run: sudo apt update && sudo apt install poppler-utils
9494

9595
- name: Checkout server
9696
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/phpunit-pgsql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9292
9393
- name: Install system dependencies
94-
run: sudo apt install poppler-utils
94+
run: sudo apt update && sudo apt install poppler-utils
9595

9696
- name: Checkout server
9797
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/phpunit-sqlite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8282
8383
- name: Install system dependencies
84-
run: sudo apt install poppler-utils
84+
run: sudo apt update && sudo apt install poppler-utils
8585

8686
- name: Checkout server
8787
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

lib/Controller/LibresignTrait.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ private function loadEntitiesFromUuid(string $uuid): void {
5454
public function validateSignRequestUuid(string $uuid): void {
5555
$this->loadEntitiesFromUuid($uuid);
5656
$this->signFileService->validateSigner($uuid, $this->userSession->getUser());
57-
$this->nextcloudFile = $this->signFileService->getNextcloudFile(
58-
$this->fileEntity->getNodeId(),
59-
);
57+
$this->nextcloudFile = $this->signFileService->getNextcloudFile($this->fileEntity);
6058
}
6159

6260
/**
@@ -65,19 +63,15 @@ public function validateSignRequestUuid(string $uuid): void {
6563
public function validateRenewSigner(string $uuid): void {
6664
$this->loadEntitiesFromUuid($uuid);
6765
$this->signFileService->validateRenewSigner($uuid, $this->userSession->getUser());
68-
$this->nextcloudFile = $this->signFileService->getNextcloudFile(
69-
$this->fileEntity->getNodeId(),
70-
);
66+
$this->nextcloudFile = $this->signFileService->getNextcloudFile($this->fileEntity);
7167
}
7268

7369
/**
7470
* @throws LibresignException
7571
*/
7672
public function loadNextcloudFileFromSignRequestUuid(string $uuid): void {
7773
$this->loadEntitiesFromUuid($uuid);
78-
$this->nextcloudFile = $this->signFileService->getNextcloudFile(
79-
$this->fileEntity->getNodeId(),
80-
);
74+
$this->nextcloudFile = $this->signFileService->getNextcloudFile($this->fileEntity);
8175
}
8276

8377
public function getSignRequestEntity(): ?SignRequestEntity {

lib/Controller/PageController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public function signAccountFile($uuid): TemplateResponse {
383383
$this->initialState->provideInitialState('signature_methods', $signatureMethods);
384384
$this->initialState->provideInitialState('token_length', TokenService::TOKEN_LENGTH);
385385
$this->initialState->provideInitialState('description', '');
386-
$nextcloudFile = $this->signFileService->getNextcloudFile($fileEntity->getNodeId());
386+
$nextcloudFile = $this->signFileService->getNextcloudFile($fileEntity);
387387
$this->initialState->provideInitialState('pdf',
388388
$this->signFileService->getFileUrl('url', $fileEntity, $nextcloudFile, $uuid)
389389
);

0 commit comments

Comments
 (0)