Incomplete/Missing error handling in NewMessageModal.onSend
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Write an email
- Click send
- An error, from the backend, is not properly handled
Expected behavior
As a User, I expected a hint/warning when something went wrong.
Actual behavior
Nothing.
To do
- Remove dead code
- Show a warning when the backend operation failed
Additional info
- NoSentMailboxConfiguredError and ManyRecipientsError are mapped from the backend exceptions^1, but the backend does not throw SentMailboxNotSetException and ManyRecipientsException anymore.
- The phpdoc for
IMailTransmission.sendMessageis outdated. NewMessageModal.onSendmay put a draft into the outbox without having a draft saved already (1), update a message in the outbox (2), update an existing draft and put it into the outbox (3).
To simulate a failure for case 1 or 3:
Index: lib/Controller/OutboxController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/Controller/OutboxController.php b/lib/Controller/OutboxController.php
--- a/lib/Controller/OutboxController.php (revision 2cfa6995f9de4d356a28e32c4f12ccf74a679717)
+++ b/lib/Controller/OutboxController.php (date 1720696979685)
@@ -145,6 +145,8 @@
// Locate the account to check authorization
$this->accountService->find($this->userId, $draftMessage->getAccountId());
+ throw new ClientException('Computer says no');
+
$outboxMessage = $this->service->convertDraft($draftMessage, $sendAt);
return JsonResponse::success(
Screencast from 2024-07-11 13-24-49.webm
There's no feedback that something went wrong, I'm just taking back to the composer, and it says, "Draft saved".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with NewMessageModal.vue around onSend and the error mappings in src/errors/convert.js; use the provided OutboxController.php failure injection to reproduce the missing feedback. Trace the draft and outbox cases, then verify that backend failures produce a warning rather than a false “Draft saved” message and that the obsolete error mappings and IMailTransmission.sendMessage phpdoc are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100