# asyncwaiter

> Fail more. Learn more.. Personal engineering blog.

## Posts

- [ReactQuery의 staleTime: 0은 정말 0일까? 왜?](https://asyncwaiter.com/2026/10/react-query-stale-time-zero.md): prefetch하고 hydrate까지 했는데 queryFn이 두 번 호출됐다. 지난 글에서는 staleTime이 0이라서라고 설명했는데, 이 설명은 옳지 못했다. Suspense 모드에서 staleTime은 최소 1,000ms로 보정된다. 왜 최소값이 필요한지, 이 시간 차는 어디서 재는지, 내 실험에서 1초를 넘긴 건 무엇이었는지를 React Query와 React 내부 코드로 따라가 봤다. 핵심은 suspend된 렌더가 아무것도 남기지 않는다는 점이었다. 그리고 같은 코드라도 실행 환경에 따라 흐르는 시간은 달라진다.
- [렌더링 경계[1]: Server Functions cannot be called during initial render](https://asyncwaiter.com/2026/10/rendering-boundary-server-functions.md): DataDog에 주 3,000건씩 쌓이던 에러를 추적했다. useSuspenseQuery가 커밋 전 렌더 단계에서 queryFn을 실행하고, 그 안에 Server Function이 들어 있던 것이 원인이었다. useQuery로 바꾸라는 조언 대신 use server 파일에서 읽기 함수를 분리해 에러를 0건으로 만들었지만, 같은 샌드박스에서 30회를 측정하자 요청은 60회가 나왔다. 서버와 브라우저의 queryClient가 다르기 때문이었다.

## Posts (English)

- [Is React Query's staleTime: 0 really 0? And why?](https://asyncwaiter.com/en/2026/10/react-query-stale-time-zero.md): I prefetched the data and even hydrated it, and queryFn was still called twice. In the last post I explained that as staleTime being 0, and the explanation was not right. In Suspense mode staleTime is clamped to a minimum of 1,000ms. I followed React Query and React internals to find out why that floor is needed, where the gap is measured, and what pushed my experiment past one second. The key was that a suspended render leaves nothing behind. And even with the same code, the time that passes changes with the environment it runs in.
- [Rendering Boundaries[1]: Server Functions cannot be called during initial render](https://asyncwaiter.com/en/2026/10/rendering-boundary-server-functions.md): I traced an error that was piling up in DataDog at about 3,000 a week. The cause was that useSuspenseQuery runs queryFn during render, before commit, and a Server Function was sitting inside it. Instead of the advice to switch to useQuery, I pulled the read function out of the use server file and the error went to zero. But when I measured 30 runs in the same sandbox, the requests came back as 60. The server and the browser have different queryClients.
