Skip to content

Fall back when crypto.randomUUID is unavailable over HTTP - #18986

Open
xhon-pelushi wants to merge 1 commit into
nextcloud:mainfrom
xhon-pelushi:fix/http-randomuuid-polyfill
Open

Fall back when crypto.randomUUID is unavailable over HTTP#18986
xhon-pelushi wants to merge 1 commit into
nextcloud:mainfrom
xhon-pelushi:fix/http-randomuuid-polyfill

Conversation

@xhon-pelushi

Copy link
Copy Markdown

Summary

  • Draft attachment uploads used crypto.randomUUID() for temporary filenames.
  • That API is unavailable in some non-secure (HTTP) contexts and threw TypeError.
  • Prefer crypto.randomUUID when present; otherwise use the existing uuid helper already used elsewhere in Talk.

Fixes #18733

Test plan

  • On an HTTP Talk instance, attach/upload a file in chat and confirm it succeeds.
  • On HTTPS, confirm uploads still work.
  • No behavior change for duplicate-name handling outside the draft-folder path.

Draft upload temp names used crypto.randomUUID(), which throws on non-secure
contexts. Use the existing uuid helper as a fallback so Talk file uploads
work over HTTP as well as HTTPS.

Fixes nextcloud#18733

Signed-off-by: xhon-pelushi <xhon@pelushi.com>

@Antreesy Antreesy 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 fine.
Please address frontend-related CI failures, reword commit message to follow convention and disclose AI usage with 'Assisted-by' trailer.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Talk fails to upload files over HTTP (crypto.randomUUID is not a function)

2 participants