Skip to content

fix(nextcloud): use correct URL format for opening files#28869

Merged
raycastbot merged 3 commits into
raycast:mainfrom
HrushiYadav:fix/nextcloud-open-file-url
Jun 19, 2026
Merged

fix(nextcloud): use correct URL format for opening files#28869
raycastbot merged 3 commits into
raycast:mainfrom
HrushiYadav:fix/nextcloud-open-file-url

Conversation

@HrushiYadav

Copy link
Copy Markdown
Contributor

Description

Opening a file from search results gives a 403 because the URL format changed in newer Nextcloud versions.

Old: /apps/files/?dir=<path>&openfile=<id>
New: /index.php/apps/files/files/<id>?dir=<path>&editing=false&openfile=true

Checklist

  • I read the extension guidelines
  • I read the documentation about publishing
  • I ran npm run build and tested this distribution build in Raycast
  • I checked that files in the assets folder are used by the extension itself
  • I checked that assets used in the README are located outside the metadata folder

Fixes #28837

The old format (/apps/files/?openfile=<id>) returns 403.
Nextcloud expects /index.php/apps/files/files/<id>?openfile=true
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: nextcloud Issues related to the nextcloud extension platform: macOS labels Jun 18, 2026
@raycastbot

raycastbot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @uetchy @xmok @jamespurnama1 you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="fix/nextcloud-open-file-url"
FORK_URL="https://github.com/HrushiYadav/extensions.git"
EXTENSION_NAME="nextcloud"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes 403 errors when opening files from Nextcloud search results by updating the URL format to match newer Nextcloud versions, and also upgrades encodeURI to encodeURIComponent in both Search and Favorites for safer path encoding.

  • Search.tsx: Replaces the deprecated /apps/files/?dir=<path>&openfile=<id> pattern with /index.php/apps/files/files/<id>?dir=<path>&editing=false&openfile=true, matching the new Nextcloud file-open URL scheme.
  • Favorites.tsx: Switches encodeURI to encodeURIComponent for directory path query parameters; the favorites view navigates to directories only, so no URL scheme change is required there.
  • CHANGELOG.md: Adds a new entry for the fix, though the date should use {PR_MERGE_DATE} instead of a hardcoded value.

Confidence Score: 5/5

The URL format change is targeted and correct — it directly addresses the 403 regression in newer Nextcloud versions without touching any other logic.

The core fix is straightforward: two lines in Search.tsx update a known-broken URL pattern to the documented Nextcloud format, and both files improve query-parameter encoding. The only issue is a minor changelog date format nit.

No files require special attention.

Important Files Changed

Filename Overview
extensions/nextcloud/CHANGELOG.md Adds a new changelog entry for the URL format fix, but uses a hardcoded date instead of the required {PR_MERGE_DATE} placeholder.
extensions/nextcloud/src/search/Search.tsx Updates the file-open URL from the deprecated /apps/files/?openfile=id format to /index.php/apps/files/files/id, and upgrades encodeURI to encodeURIComponent for the dir parameter.
extensions/nextcloud/src/favorites/Favorites.tsx Upgrades encodeURI to encodeURIComponent for directory path query parameters; no URL scheme change needed since Favorites only navigates to directories, not specific files.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/nextcloud/CHANGELOG.md:3
The changelog entry uses a hardcoded date instead of the `{PR_MERGE_DATE}` template placeholder. Per the Raycast changelog convention, the merge date is automatically populated at release time — a hardcoded date will be wrong if the PR merges on a different day.

```suggestion
## [Fix Open File URL format] - {PR_MERGE_DATE}
```

Reviews (3): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

Comment thread extensions/nextcloud/src/search/Search.tsx Outdated
encodeURI leaves &, #, ? unescaped which breaks paths like
/Projects/R&D or /Team raycast#1
@0xdhrv 0xdhrv self-assigned this Jun 19, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved ✅

@raycastbot raycastbot merged commit 53c7f5d into raycast:main Jun 19, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/uetchy/nextcloud

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

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

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: nextcloud Issues related to the nextcloud extension platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Nextcloud] ... Open File link is badly formed

3 participants