Skip to content

fix: Robustly parse file action responses and handle tooltip/URL children - #9547

Merged
mgallien merged 5 commits into
masterfrom
codex/find-unhandled-url-scheme-issue
Mar 11, 2026
Merged

fix: Robustly parse file action responses and handle tooltip/URL children#9547
mgallien merged 5 commits into
masterfrom
codex/find-unhandled-url-scheme-issue

Conversation

@Rello

@Rello Rello commented Feb 28, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Support server responses that wrap payload in the ocs.data envelope and use tooltip for success messages.
  • Avoid failing when the root element is absent or when child elements are incomplete.
  • Correctly resolve relative child url values against _accountUrl and improve logging for unsupported response elements.

Description

  • Added #include <optional> and updated FileActionsModel::processRequest to extract ocs.data and the tooltip string from the JSON response.
  • Use a fallback to ocs.data.root when top-level root is empty and prefer tooltip over the generic success message when present.
  • Introduced setGenericResponse and parseChildResponse lambdas; parseChildResponse returns a std::optional<Response> and validates element, text, and url fields and resolves relative URLs against _accountUrl.
  • Improved handling of child rows by using parsed responses when available, logging unsupported elements, and falling back to a generic response when parsing fails.

Testing

  • Built the project with cmake and the changes compiled without errors.
  • Ran the automated test suite with ctest, and all tests completed successfully.

Codex Task

@Rello Rello changed the title Robustly parse OCS-wrapped file action responses and handle tooltip/URL children fix: Robustly parse file action responses and handle tooltip/URL children Feb 28, 2026
@Rello
Rello force-pushed the codex/find-unhandled-url-scheme-issue branch from fa25c7a to bfa5972 Compare February 28, 2026 21:08
@Rello

Rello commented Mar 1, 2026

Copy link
Copy Markdown
Collaborator Author

Responses are parsed correctly

Return URL from client integration with URL type:

Bildschirmfoto 2026-03-01 um 09 55 54

Message from client integration, that is sending a tooltip:

Bildschirmfoto 2026-03-01 um 09 56 10

@Rello Rello linked an issue Mar 1, 2026 that may be closed by this pull request
5 tasks
@mgallien
mgallien force-pushed the codex/find-unhandled-url-scheme-issue branch from 805dd51 to 296083b Compare March 11, 2026 13:28
@mgallien
mgallien enabled auto-merge March 11, 2026 13:29
@github-actions

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-9547.zip

Digest: sha256:59c7aec08694d6745d3e5cbbb1360f6704003f24321c7c10b8240062ba072347

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@mgallien
mgallien merged commit 9b05ecb into master Mar 11, 2026
22 checks passed
@mgallien
mgallien deleted the codex/find-unhandled-url-scheme-issue branch March 11, 2026 14:09
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
25.5% Coverage on New Code (required ≥ 80%)
B Maintainability Rating on New Code (required ≥ A)
13 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@nilsding

Copy link
Copy Markdown
Member

/backport to stable-33.0

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client integration with server apps issues

4 participants