Skip to content

[stable34] fix: accept string node ids from the Files sidebar when requesting a signature - #8394

Closed
backportbot-libresign[bot] wants to merge 1 commit into
stable34from
backport/8367/stable34
Closed

backportbot-libresign[bot] wants to merge 1 commit into
stable34from
backport/8367/stable34

Conversation

@backportbot-libresign

@backportbot-libresign backportbot-libresign Bot commented Sep 13, 2026

Copy link
Copy Markdown

Backport of #8367

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot-libresign backportbot-libresign Bot added this to the Next Patch (34) milestone Sep 13, 2026
@github-project-automation github-project-automation Bot moved this to 0. Backlog in Roadmap Sep 13, 2026
@vitormattos
vitormattos force-pushed the backport/8367/stable34 branch 3 times, most recently from af83687 to 5185198 Compare September 13, 2026 22:04
…gnature

fix: keep string node ids from the Files sidebar when requesting a signature

`tab.ts` builds `fileInfo.id` from `node.fileid ?? node.id`. With

`@nextcloud/files`, `fileid` is the deprecated numeric getter and is

`undefined` when the id does not fit a JavaScript number, while `id` is

always a string; a file copied in the Files app and opened in the

sidebar hits this path too. `AppFilesTab.update()` stored that string as

`nodeId` unchanged, but `serializeRequestFile()` only accepted numbers,

so the request went out without `file` and the API answered 422 "File

or files parameter is required".

Keep `nodeId` in the string domain instead of converting it: the

serializer forwards a positive integer or a string of digits as it is,

and the API accepts both. `fileId` and `id` only ever come from the

LibreSign API as numbers and are not touched. The `FileInfo.id` type of

`AppFilesTab` now matches what `tab.ts` sends.

Tests follow the sidebar path with a node id above

`Number.MAX_SAFE_INTEGER`: `tab.ts` keeps the string, `AppFilesTab`

passes it through, and the store sends it unchanged for a single file

and for envelope files; the empty id `tab.ts` falls back to is still not

sent.

Resolves: #8363

Assisted-by: Claude Code:claude-opus-5

Signed-off-by: André Maia <andrefnkmm@gmail.com>

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@maia-andre

Copy link
Copy Markdown
Contributor

This cherry-pick only carried the frontend commit (the backend one conflicted), so on stable34 the string would now reach the services raw. #8396 replaces it: same frontend commit plus a branch-specific RequestSignatureController::normalizeNodeId(), the same shape as the stable35 backport. Could you close this one in favour of #8396?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

2 participants