-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Description:
We're encountering two issues with the Catalyst's clientFetcher
:
1. Crash when accessing params
from third argument
NotificationsPage.clientFetcher = (_, { store }, { params }) => {
return makeApiCall("/app-api/v1/app/notifications", {
dispatch: store.dispatch,
params
})
}
When trying to access params
from the third argument in clientFetcher
, it throws the following error:
TypeError: Cannot destructure undefined
at _objectDestructuringEmpty (http://localhost:3006/app.bundle.js:5619:56)
at push.5722.Home.clientFetcher (http://localhost:3006/app.bundle.js:5619:5066)
at http://localhost:3006/npm.router.dist.index.js..bundle.js:11:22045
at p (http://localhost:3006/npm.router.dist.index.js..bundle.js:11:14304)
at Generator.<anonymous> (http://localhost:3006/npm.router.dist.index.js..bundle.js:11:15650)
at Generator.next (http://localhost:3006/npm.router.dist.index.js..bundle.js:11:14733)
at g (http://localhost:3006/npm.router.dist.index.js..bundle.js:11:20219)
at s (http://localhost:3006/npm.router.dist.index.js..bundle.js:11:20422)
at http://localhost:3006/npm.router.dist.index.js..bundle.js:11:20481
at new Promise (<anonymous>)
2. refetch
returns stale data
The refetch
function behavior is inconsistent:
- Calling
refetch()
without params returns the initial page-load API data instead of returning fresh data. - Passing new params to
refetch(params)
causes the function to break, likely due to the above destructuring issue.
Expected:
refetch
should always trigger a fresh API call and return the latest data.refetch
with new params should properly update the fetch without breaking.
Steps to Reproduce:
- Access
params
from the third argument inclientFetcher
. - Call
refetch()
without or with params after initial page load. - Observe error and stale data being returned.
- Catalyst client version: 0.0.3-canary.11
Metadata
Metadata
Assignees
Labels
No labels