Skip to content

Reintroduce useSWR - #409

Merged
aldbr merged 1 commit into
DIRACGrid:mainfrom
TheauW:twartel-reintroduce-use-swr
Feb 23, 2026
Merged

Reintroduce useSWR#409
aldbr merged 1 commit into
DIRACGrid:mainfrom
TheauW:twartel-reintroduce-use-swr

Conversation

@TheauW

@TheauW TheauW commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

This PR is an alternative to: #408
As suggested in that PR, I reintroduced useSWR to avoid fetching resources on every mount.

The results are as expected. However, when opening the module for the very first time, no data is fetched, since we explicitly prevent fetching on every mount. The initial mount is therefore treated just like any other remount. This point still needs to be addressed.

One possible approach would be to use a useEffect that checks if the data is null and there is no error (which should normally never happen in our model), and then triggers a mutate on the key.

@TheauW
TheauW marked this pull request as draft August 27, 2025 12:35
@aldbr
aldbr force-pushed the twartel-reintroduce-use-swr branch from d32a9eb to 964234d Compare February 23, 2026 07:39
@aldbr
aldbr marked this pull request as ready for review February 23, 2026 07:41
@aldbr
aldbr merged commit 9cb7bf6 into DIRACGrid:main Feb 23, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not refresh automatically the job monitor if we switch to another app internally

2 participants