react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

After some minutes opening an expand clears the list

Open esistgut opened this issue 7 years ago • 6 comments

I'm seeing this locally using react-admin-2.9.1 but the issue is visible on the demo/invoices page aswell.

The expected behaviour is the one we can see just after opening the page and clicking on the expand arrow: the expand opens and every other record on the list remains visible.

If you open the invoices list, wait for 5-10 minutes (I'm not sure about the exact timeout) and click an expand arrow the expand opens correcly but every other item on the list disappear.

esistgut avatar May 15 '19 12:05 esistgut

Thanks, I reproduced the issue. It's easier to spot by lowering down the defaultCacheDuration in packages/ra-core/src/util/getFetchedAt.ts.

the problem comes from packages/ra-core/src/reducer/admin/resource/list/ids.ts, which invalidates outdated elements in the list when a CRUD_GET_ONE_SUCCESS is dispatched. In that case, the reducer should only replace the existing record with the new one and not invalidate the others.

fzaninotto avatar May 15 '19 16:05 fzaninotto

@fzaninotto

Is this issue fixed. we're waiting for this fix because I got this problem too.

thanks for your framework :)

hoangtuan438 avatar Sep 17 '19 07:09 hoangtuan438

@hoangtuan438 As you can see, a PR is open to fix the issue.

The author didn't give news from a month or so, hence the issue isn't fixed. Feel free to open your own PR to fix the issue! It is marked as good first issue so, it's manageable from entry level contributor :)

Kmaschta avatar Sep 20 '19 07:09 Kmaschta

@Kmaschta thanks for your feedback. I saw this PR but how can I add the fix to the dependency in package.json. I tried it, but it doesn't work. The author said the react-admin is mono-repository, so we can't do that Do you know how to include the PR to dependency

hoangtuan438 avatar Sep 20 '19 08:09 hoangtuan438

~~I am very sorry, I did not know you were waiting for my input. Will test ASAP.~~ Oh I guess you meant the author of the PR, nevermind, ignore me.

esistgut avatar Sep 20 '19 10:09 esistgut

Fixed by #4261

fzaninotto avatar Jan 09 '20 17:01 fzaninotto