Skip to content

fix(pastebin): copy the pastebin view link after creating a pastebin - #629

Merged
JammingBen merged 2 commits into
mainfrom
fix/pastebin-copied-link
Oct 20, 2026
Merged

JammingBen merged 2 commits into
mainfrom
fix/pastebin-copied-link

Conversation

@dschmidt

@dschmidt dschmidt commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

After creating a pastebin, the app copied the raw share link (/s/<token>), which opens the folder with manifest.json and revisions/. It now copies the link to the pastebin view (/pastebin/view/public/<token>), the same one the "Copy public link" button in the view uses. The toast shows it too.

Both places now share one helper. It resolves the pastebin-view route and builds the absolute URL with buildUrl from web-pkg, instead of joining configStore.serverUrl (the backend URL) with a hard-coded path. So the link also points to the right place when web is served from a different origin or base path.

opencloud-eu/web#3798 lets buildUrl take the route location directly. Once a release with it is the minimum, the extra router.resolve can go.

Related Issue

How Has This Been Tested?

  • test environment: OpenCloud 8.1.0 (opencloud-rolling:8.1.0) with a development build of the app
  • unit tests for the token extraction and the URL helper
  • e2e: createPastebin now reads the clipboard after "Create Pastebin". "public link works unauthenticated" checks that the copied link ends in /pastebin/view/public/<token>, matches the header button link, and opens with the link password without login. It fails on main (/s/<token>) and passes with this change.
  • all pastebin e2e tests pass in Chromium and Firefox (27 each), plus type check and lint

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Creating a pastebin copied the raw share link, which opens the folder with manifest.json and revisions/ instead of the pastebin. Copy the link to the pastebin view instead, built like the view's own copy button but with buildUrl, so it points to where web is served rather than to the backend URL.
@dschmidt
dschmidt marked this pull request as ready for review October 14, 2026 14:29
@dschmidt
dschmidt requested a review from JammingBen October 19, 2026 07:38

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@JammingBen
JammingBen merged commit d77c15e into main Oct 20, 2026
5 checks passed
@JammingBen
JammingBen deleted the fix/pastebin-copied-link branch October 20, 2026 07:43
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.

[pastebin] Link copied after creation opens folder view instead of pastebin content

2 participants