A copy the browser refuses shows "Unknown error" and is logged as critical

Open
#15,049 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp, wasm
Domain
frontend

Research direction

Start with ClientExceptionHandlerBase, which turns a clipboard refusal from Butil's Clipboard.WriteText into the generic unknown-error dialog and a Critical log entry. The copy call sites are the two-factor key and recovery codes on Settings, the diagnostic modal and report, Operations, and the landing page share button. Done when a refused copy shows a message asking the user to select the text manually and is not logged as critical, and the behaviour is unchanged in Development.

Written by the indexing model from the issue text.

Description

The template's copy buttons call Butil's Clipboard.WriteText and let a failure reach WrapHandled: the two-factor key and the recovery codes on the Settings page, the diagnostic modal and report, the Operations page, and the landing page's share button and copied texts. A browser may refuse a clipboard write, for example in an embedded web view, on a page that isn't a secure context, or in a frame without the clipboard-write permission. ClientExceptionHandlerBase then treats the refusal as an unexpected error: outside Development the user gets a dialog saying an unknown error happened, and the log gets a Critical entry for what is the browser's choice rather than a defect.

A refused copy should tell the user the text couldn't be copied, so they can select it themselves, and shouldn't be logged as critical.

Dominant language
C#
Stars
1.4k
Forks
264
Avg merge
7h 38m
Merged PRs (30d)
544

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bitfoundation/bitplatform

All issues in bitfoundation/bitplatform

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.