Skip to content

fix: improve attachment upload error notification data #1542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MartinCupela
Copy link
Contributor

Goal

Closes REACT-399

Provide more contextual information regarding the reasons of upload failure or blockage.
Add code property to the Notification type to allow to identify notifications based on a type (kind of a grouping).

Copy link
Contributor

github-actions bot commented May 22, 2025

Size Change: +398 B (+0.1%)

Total Size: 382 kB

Filename Size Change
dist/cjs/index.browser.cjs 108 kB +123 B (+0.11%)
dist/cjs/index.node.cjs 152 kB +129 B (+0.08%)
dist/esm/index.js 121 kB +146 B (+0.12%)

compressed-size-action

Comment on lines +463 to +465
metadata: {
reason: localAttachment.localMetadata.uploadPermissionCheck?.reason,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth adding original error object at the same level the reason property is (if this is available in the UI)? ErrorFromResponse contains quite a bit of data which could be useful, like code and status numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this not a error from a response. This is a reason calculated based on the back-end config.

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad, this was a wrong pick but there are other invocations where the error object is available.

options: {
code: 'poll.creation.failed',
metadata: {
reason: (error as Error).message,
Copy link
Contributor

Choose a reason for hiding this comment

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

👆 here for example

Co-authored-by: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com>
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.

2 participants