react-admin: Failure to delete crashes the app

What you were expecting:

Clicking on the delete button may fail because it can happen that the user was deleted in the meantime.

image

If this happens, the graphql dataprovider sends an user not found error.

It should gracefully display the error (as it does for most errors), and carry on.

What happened instead:

image

Steps to reproduce:

Simply make the deletion operation fail.

Environment

  • React-admin version: 3.3.3
  • React version: 16.13.1
  • Browser: Chrome
index.js:1 Warning: Missing translation for key: "GraphQL error: User not found" 
    in Notification (created by Layout)
    in Layout (created by WithStyles(Layout))
    in WithStyles(Layout) (created by Router.Consumer)
    in Router.Consumer (created by withRouter(WithStyles(Layout)))
    in withRouter(WithStyles(Layout)) (created by ConnectFunction)
    in ConnectFunction (created by LayoutWithTheme)
    in LayoutWithTheme (created by Router.Consumer)
    in Router.Consumer (created by Route)
    in Route (created by CoreAdminRouter)
    in CoreAdminRouter (created by Router.Consumer)
    in Router.Consumer (created by Route)
    in Route (created by CoreAdminUI)
    in CoreAdminUI (created by AdminUI)
    in AdminUI (created by Admin)
    in Admin (at App.tsx:34)
    in App (at src/​index.tsx:7)
console.<computed> @ index.js:1
r @ react_devtools_backend.js:6
printWarning @ warning.js:34
warning @ warning.js:57
warn @ index.js:26
push.../node_modules/node-polyglot/index.js.Polyglot.t @ index.js:369
translate @ index.js:41
(anonymous) @ useTranslate.js:25
Notification @ Notification.js:68
renderWithHooks @ react-dom.development.js:14803
updateFunctionComponent @ react-dom.development.js:17034
beginWork @ react-dom.development.js:18610
beginWork$1 @ react-dom.development.js:23179
performUnitOfWork @ react-dom.development.js:22154
workLoopSync @ react-dom.development.js:22130
performSyncWorkOnRoot @ react-dom.development.js:21756
(anonymous) @ react-dom.development.js:11089
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushSyncCallbackQueueImpl @ react-dom.development.js:11084
flushSyncCallbackQueue @ react-dom.development.js:11072
flushPassiveEffectsImpl @ react-dom.development.js:22883
unstable_runWithPriority @ scheduler.development.js:653
runWithPriority$1 @ react-dom.development.js:11039
flushPassiveEffects @ react-dom.development.js:22820
(anonymous) @ react-dom.development.js:22699
workLoop @ scheduler.development.js:597
flushWork @ scheduler.development.js:552
performWorkUntilDeadline @ scheduler.development.js:164
ApolloError.ts:46 Uncaught (in promise) Error: GraphQL error: User not found
    at new ApolloError (ApolloError.ts:46)
    at Object.next (QueryManager.ts:225)
    at notifySubscription (Observable.js:135)
    at onNotify (Observable.js:179)
    at SubscriptionObserver.next (Observable.js:235)
    at observables.ts:12
    at Set.forEach (<anonymous>)
    at Object.next (observables.ts:12)
    at notifySubscription (Observable.js:135)
    at onNotify (Observable.js:179)
    at SubscriptionObserver.next (Observable.js:235)
    at httpLink.ts:142

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

“Setup a graphql server” isn’t simple enough.

Well yeah, that is why I cannot provide you a simple codesandbox for you to play with 😅 I see no simpler way to reproduce the error. So we’re gonna sweep it under the carpet, because reproducing it is not simple?