Skip to content

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

Open
Rello wants to merge 5 commits intomasterfrom
codex/find-unhandled-url-scheme-issue
Open

fix: Robustly parse file action responses and handle tooltip/URL children#9547
Rello wants to merge 5 commits intomasterfrom
codex/find-unhandled-url-scheme-issue

Conversation

@Rello
Copy link
Collaborator

@Rello Rello commented Feb 28, 2026

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
Signed-off-by: Rello <Rello@users.noreply.github.com>
@Rello Rello force-pushed the codex/find-unhandled-url-scheme-issue branch from fa25c7a to bfa5972 Compare February 28, 2026 21:08
@Rello
Copy link
Collaborator Author

Rello commented Mar 1, 2026

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
Signed-off-by: Camila Ayres <hello@camilasan.com>
Signed-off-by: Camila Ayres <hello@camilasan.com>
Signed-off-by: Camila Ayres <hello@camilasan.com>
Signed-off-by: Camila Ayres <hello@camilasan.com>
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

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

Digest: sha256:c9a943906f79820c91bae2c9967cb1b228efa7bc91043e6d631607e2cd57dd78

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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

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

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

2 participants