Skip to content

[PB-5882]: feat/show request Id if exists when an error occurs#1859

Merged
xabg2 merged 9 commits intomasterfrom
feature/show-request-id-in-toast-when-something-fails
Feb 17, 2026
Merged

[PB-5882]: feat/show request Id if exists when an error occurs#1859
xabg2 merged 9 commits intomasterfrom
feature/show-request-id-in-toast-when-something-fails

Conversation

@xabg2
Copy link
Contributor

@xabg2 xabg2 commented Feb 13, 2026

Description

When a request fails and the x-request-id header is available in the response, it is included in the error toast notification.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

@xabg2 xabg2 self-assigned this Feb 13, 2026
@xabg2 xabg2 added the enhancement New feature or request label Feb 13, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 13, 2026

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7aea870
Status: ✅  Deploy successful!
Preview URL: https://8bb795ca.drive-web.pages.dev
Branch Preview URL: https://feature-show-request-id-in-t.drive-web.pages.dev

View logs

@xabg2 xabg2 marked this pull request as ready for review February 16, 2026 08:08
@xabg2 xabg2 requested review from a team, CandelR and larryrider as code owners February 16, 2026 08:08
Copy link
Member

@sg-gs sg-gs left a comment

Choose a reason for hiding this comment

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

Just a thing that could be more maintainable if possible: could be better to decorate the error inside the SDK, where the client centralises the error handling rather than expanding the cast function around this app? This + showing the requestId on the toast if it is present could be easier to manage, considering that this could be extended to other apps like Meet and other platforms like Mobile

@xabg2
Copy link
Contributor Author

xabg2 commented Feb 16, 2026

Just a thing that could be more maintainable if possible: could be better to decorate the error inside the SDK, where the client centralises the error handling rather than expanding the cast function around this app? This + showing the requestId on the toast if it is present could be easier to manage, considering that this could be extended to other apps like Meet and other platforms like Mobile

Okay, now we return tthe requestId in the error if it is present in the response headers.
The castError function now simply returns the error as-is when it is an instance of AppError. Otherwise, it extracts the headers from a generic Error (for example, errors automatically cast by async functions) to retrieve the requestId when available. We do not fetch the requestId manually anymore.

I will push the changes once the SDK PR is merged and new release is done.


if (backupData.mnemonic && validateMnemonic(backupData.mnemonic)) {
setBackupKeyContent(uploadedBackupKeyContent);
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why have removed this return?

Copy link
Contributor Author

@xabg2 xabg2 Feb 16, 2026

Choose a reason for hiding this comment

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

Because it is no longer needed. I added the error notification in the catch, not outside.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah right! 👌
But be careful, because now if there is no mnemonic in backupData, the error message does not appear, whereas before it did

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lol. Let me change it then

Comment on lines 19 to 23
const handleCopyRequestId = () => {
if (requestId) {
navigator.clipboard.writeText(requestId);
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

WWhen the user presses copy, some visual feedback would be great, otherwise they won't know if it has been copied to the clipboard or not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed

@xabg2 xabg2 requested a review from CandelR February 16, 2026 15:19
@sonarqubecloud
Copy link

@xabg2 xabg2 merged commit ce4013d into master Feb 17, 2026
9 of 10 checks passed
@xabg2 xabg2 deleted the feature/show-request-id-in-toast-when-something-fails branch February 17, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants