Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ public function setSigningModeConfig(string $mode, ?string $workerType = null):
], Http::STATUS_BAD_REQUEST);
}

$this->saveOrDeleteConfig('signing_mode', $mode, 'async');
$this->saveOrDeleteConfig('signing_mode', $mode, 'sync');
$this->saveOrDeleteConfig('worker_type', $workerType, 'local');

return new DataResponse([
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/SigningCoordinatorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function shouldUseParallelProcessing(int $signRequestCount): bool {
return false;
}

$signingMode = $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'async');
$signingMode = $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'sync');
return $signingMode === 'async';
}
}
2 changes: 1 addition & 1 deletion lib/Service/Worker/WorkerConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(
}

public function isAsyncLocalEnabled(): bool {
$signingMode = $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'async');
$signingMode = $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'sync');
if ($signingMode !== 'async') {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getForm(): TemplateResponse {
$this->initialState->provideInitialState('tsa_password', $this->appConfig->getValueString(Application::APP_ID, 'tsa_password', self::PASSWORD_PLACEHOLDER));
$this->initialState->provideInitialState('docmdp_config', $this->docMdpConfigService->getConfig());
$this->initialState->provideInitialState('signature_flow', $this->appConfig->getValueString(Application::APP_ID, 'signature_flow', \OCA\Libresign\Enum\SignatureFlow::NONE->value));
$this->initialState->provideInitialState('signing_mode', $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'async'));
$this->initialState->provideInitialState('signing_mode', $this->appConfig->getValueString(Application::APP_ID, 'signing_mode', 'sync'));
$this->initialState->provideInitialState('worker_type', $this->appConfig->getValueString(Application::APP_ID, 'worker_type', 'local'));
$this->initialState->provideInitialState('envelope_enabled', $this->appConfig->getValueString(Application::APP_ID, 'envelope_enabled', '1') === '1');
$this->initialState->provideInitialState('parallel_workers', $this->appConfig->getValueString(Application::APP_ID, 'parallel_workers', '4'));
Expand Down
2 changes: 1 addition & 1 deletion src/views/Settings/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Validation />
<DocMDP />
<SignatureFlow />
<SigningMode />
<SigningMode v-if="false" />
<AllowedGroups />
<LegalInformation />
<IdentificationDocuments />
Expand Down
6 changes: 3 additions & 3 deletions src/views/Settings/SigningMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
data() {
return {
name: t('libresign', 'Signing mode'),
asyncEnabled: true,
asyncEnabled: false,
externalWorkerEnabled: false,
parallelWorkersCount: '4',
lastSavedParallelWorkers: '4',
Expand All @@ -118,7 +118,7 @@ export default {
methods: {
loadConfig() {
try {
const mode = loadState('libresign', 'signing_mode', 'async')
const mode = loadState('libresign', 'signing_mode', 'sync')
this.asyncEnabled = mode === 'async'

const workerType = loadState('libresign', 'worker_type', 'local')
Expand All @@ -130,7 +130,7 @@ export default {
} catch (error) {
console.error('Error loading signing mode configuration:', error)
this.errorMessage = t('libresign', 'Could not load configuration.')
this.asyncEnabled = true
this.asyncEnabled = false
this.externalWorkerEnabled = false
this.parallelWorkersCount = '4'
}
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Unit/Service/SigningCoordinatorServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testShouldUseParallelProcessingReturnsFalseForSingleSigner(): vo
public function testShouldUseParallelProcessingReadsConfig(string $mode, bool $expected): void {
$this->appConfig->expects($this->once())
->method('getValueString')
->with(Application::APP_ID, 'signing_mode', 'async')
->with(Application::APP_ID, 'signing_mode', 'sync')
->willReturn($mode);

$this->assertSame($expected, $this->service->shouldUseParallelProcessing(2));
Expand Down
6 changes: 3 additions & 3 deletions tests/php/Unit/Service/Worker/WorkerConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testIsAsyncLocalEnabledRequiresBothConditions(): void {
$this->appConfig->expects($this->exactly(2))
->method('getValueString')
->willReturnMap([
[Application::APP_ID, 'signing_mode', 'async', 'async'],
[Application::APP_ID, 'signing_mode', 'sync', 'async'],
[Application::APP_ID, 'worker_type', 'local', 'local'],
]);

Expand All @@ -42,7 +42,7 @@ public function testIsAsyncLocalEnabledRequiresBothConditions(): void {
public function testIsAsyncLocalEnabledFalseWhenSigningModeNotAsync(): void {
$this->appConfig->expects($this->once())
->method('getValueString')
->with(Application::APP_ID, 'signing_mode', 'async')
->with(Application::APP_ID, 'signing_mode', 'sync')
->willReturn('sync');

$service = $this->makeService();
Expand All @@ -53,7 +53,7 @@ public function testIsAsyncLocalEnabledFalseWhenWorkerTypeNotLocal(): void {
$this->appConfig->expects($this->exactly(2))
->method('getValueString')
->willReturnMap([
[Application::APP_ID, 'signing_mode', 'async', 'async'],
[Application::APP_ID, 'signing_mode', 'sync', 'async'],
[Application::APP_ID, 'worker_type', 'local', 'remote'],
]);

Expand Down
Loading