You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Aman-Mittal (via GitHub)" <gi...@apache.org> on 2026/08/07 16:28:57 UTC
[I] A failed save or delete tells the user nothing — 114 handlers report only to the browser console [fineract-backoffice-ui]
Aman-Mittal opened a new issue, #252:
URL: https://github.com/apache/fineract-backoffice-ui/issues/252
## Business value
When a write fails, the user is not told. The error handler logs to the browser console and stops, so from the operator's side the button was pressed and nothing happened — no message, no change on screen, no indication whether to try again.
In a banking back office that is worse than an error dialog. The two outcomes an operator has to distinguish are "the platform rejected this" and "the platform accepted this and the screen has not caught up", and a silent failure looks identical to both. The realistic responses are to press the button again — which risks a duplicate for anything that did in fact succeed — or to assume it worked and move on, which leaves the record in a state nobody knows about until it surfaces in a reconciliation.
Fineract's rejections are also the useful kind. It answers with a specific reason: a mandatory parameter missing, a date outside the allowed range, a status that forbids the command. All of that is discarded.
The application already has the piece needed to fix it. `NotificationService` is used correctly in some newer components; these 114 sites predate that habit.
## Reproducing it
```
grep -rn '=> console\.error' src/app/features --include=*.ts | grep -v spec | wc -l # 114
```
By feature: products 23, loans 22, clients 22, system 21, working-capital 10, accounting 4, transfers 3, security 2, mix 2, and one each in settings, reporting and organization.
The shape is consistent:
```ts
// src/app/features/clients/tabs/client-notes-list.component.ts
this.noteService.deleteResourceTypeResourceIdNotesNoteId('clients', this.clientId(), id).subscribe({
next: () => this.loadNotes(),
error: (err) => console.error('Failed to delete note', err),
});
```
To see it: open a client's notes, stop the backend (or use devtools to fail the request), and delete a note. The row stays, and nothing tells you why.
## Describing the change
Report the failure to the user through `NotificationService`, with a translated message:
```ts
private readonly notifications = inject(NotificationService);
private readonly i18n = inject(I18N);
// ...
error: () => void this.notifications.error(this.i18n.translate('CLIENTS.NOTE_DELETE_FAILED')),
```
Three things worth getting right:
- **Keep the message about the action, not the exception.** "The note could not be deleted." is what the user needs; the raw platform message is often a validation code that means nothing to them. Whether to surface the platform's `defaultUserMessage` as well is a fair question to raise on the PR — do not do it silently in a first pass.
- **Reset any pending state.** Several of these sites set an `isSaving` or `isLoading` flag before the request and only clear it in `next`, so a failure leaves the form's submit button disabled for good. Clear it in `error` too.
- **A failed *load* is a different problem** and is already tracked in #223 — that one wants the table's `hasError` retry state, not a toast. This issue is about writes: save, update, delete, and commands.
**One pull request per feature directory**, please, and a first contribution should take one feature rather than all twelve. `organization`, `settings` and `reporting` are one site each and are the gentlest starting point; `clients`, `loans`, `products` and `system` are the substantial ones.
## Scope
In scope: the write-path handlers listed above — a user-facing error message, and clearing any pending flag.
Out of scope: failed list loads (#223), a global `ErrorHandler`, retry behaviour, and replacing `console.error` where it genuinely reports a programming fault rather than a rejected request.
## Getting started
- `NotificationService` is at `src/app/core/services/notification.service.ts`; `I18N` is covered in `DOCS/ADAPTERS.md`.
- `src/app/features/groups/group-note-form.component.ts` and `src/app/features/groups/tabs/group-notes-list.component.ts` show the intended shape on both a form and a list.
- Message keys go in `src/assets/i18n/en.json` under the feature's existing section.
- A unit spec asserting the notification is welcome — `provideFakeAdapters()` in `src/app/testing/adapters.ts` records every toast requested, so the assertion is on the request rather than on the DOM.
- `npm run build`, `npm run lint` and `npm test` must pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] A failed save or delete tells the user nothing — 114 handlers report only to the browser console [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal closed issue #252: A failed save or delete tells the user nothing — 114 handlers report only to the browser console
URL: https://github.com/apache/fineract-backoffice-ui/issues/252
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] A failed save or delete tells the user nothing — 114 handlers report only to the browser console [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on issue #252:
URL: https://github.com/apache/fineract-backoffice-ui/issues/252#issuecomment-5219691281
Closing this — I filed it on a premise that turns out to be wrong, and I would rather retract it than leave someone chasing a problem that is not there.
The claim was that a failed write tells the user nothing. It does. `errorInterceptor` (`src/app/core/interceptors/error.interceptor.ts`) is registered globally in `app.config.ts` and raises a toast carrying the platform's own message for every failed request:
```ts
if (!req.context.get(SKIP_ERROR_TOAST)) {
notifications.error(messageFor(error, i18n));
}
```
`messageFor` prefers `defaultUserMessage`, and stacks Fineract's `errors[]` array when there is one. Its unit specs cover exactly that, including the opt-out (`error.interceptor.spec.ts`, "should handle single developerMessage or defaultUserMessage" and "should not toast when the SKIP_ERROR_TOAST context is set"). Nothing under `src/app/features` sets `SKIP_ERROR_TOAST`, so there are no components opting out of it.
So the 114 `console.error` handlers are redundant logging next to a toast that already fired — not silent failures. That is minor noise, not worth a contributor's afternoon.
I also checked the one thing that would still have been a real bug behind those handlers — a pending `isSaving`/`isLoading` flag set before the request and cleared only in `next`, which would leave a submit button disabled for good after one failure. I could not find an instance of it.
What I got wrong: I read the call sites and inferred the behaviour from them, instead of checking whether something upstream already handled it. The grep was accurate; the conclusion drawn from it was not.
#223 (a failed list *load* looks like an empty list) is a separate and still-real problem, and is the better issue to pick up in this area — a toast that has already faded does not help a user staring at a table that appears to hold no records.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org