Skip to content

fix(listener): notify callback based on signedNodeId/signedHash - #8406

Open
henmohr wants to merge 1 commit into
LibreSign:stable35from
henmohr:fix/signed-callback-listener
Open

henmohr wants to merge 1 commit into
LibreSign:stable35from
henmohr:fix/signed-callback-listener

Conversation

@henmohr

@henmohr henmohr commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Problem

The webhook/callback configured via the callback field of request-signature was never fired after the document was signed.

Root cause

SignedCallbackListener::handle() checked for a signed key in the entity's updated fields:

if (isset($updatedFields['signed']) && $updatedFields['signed'] === true) {
    $this->signFileService->notifyCallback($event->getSignedFile());
}

However, the File entity does not have a signed field. The signature is tracked by signedNodeId and signedHash, which are set in SignFileService::updateLibreSignFile() (via setSignedNodeId/setSignedHash). As a result the condition was always false and the callback was never notified.

Fix

Check signedNodeId/ signedHash instead:

if (!empty($updatedFields['signedNodeId']) || !empty($updatedFields['signedHash'])) {
    $this->signFileService->notifyCallback($event->getSignedFile());
}

Testing

Verified against Nextcloud 35 + LibreSign stable35: after signing, the callback URL now receives the multipart POST (uuid, status, file) automatically. Previously it required a manual invocation of the callback endpoint.

@henmohr
henmohr requested a review from a team as a code owner September 15, 2026 13:22
@github-project-automation github-project-automation Bot moved this to 0. Backlog in Roadmap Sep 15, 2026
The SignedCallbackListener checked a 'signed' field in the updated fields,
but the File entity tracks the signature via signedNodeId and signedHash
(set by SignFileService::updateLibreSignFile). Because 'signed' never
exists, the callback URL was never notified after the document was signed.

Check signedNodeId/signedHash instead so the webhook fires on signing.

Signed-off-by: henmohr <henriquemohr@redes.ufsm.br>
@henmohr
henmohr force-pushed the fix/signed-callback-listener branch from e2f1906 to c003a93 Compare September 15, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 0. Backlog

Development

Successfully merging this pull request may close these issues.

1 participant