akiomik / akiomik/nosvelte

Refetch triggers and retry are left at TanStack Query defaults

オープン 初心者向け
#75 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
TypeScript
スター
29
フォーク
3
平均マージ
3時間 5分
マージ済み PR(30日)
11

説明

`NostrApp` sets only `staleTime` and `refetchInterval`
(`src/lib/components/NostrApp.svelte:20-24`):

```ts
const defaultQueryClientConfig = {
defaultOptions: { queries: { staleTime: 1000 * 60, refetchInterval: Infinity } }
};
```

`refetchOnWindowFocus` (TanStack default `true`), `refetchOnMount`,
`refetchOnReconnect` and `retry` (default `3`) are left untouched.

Consequences:

- 60 seconds after a request settles, tabbing back into the app refetches every
visible query. Each refetch re-subscribes the operator chain, which restarts
`scanArray()` / `scanLatestEach()` from their seeds — a timeline of 50 notes
collapses to 1 and slowly regrows. (Filed separately.)
- An exception thrown by an operator produces three re-subscriptions and three
`console.error` lines before the query gives up.

A subscription-backed data source has no notion of "the data went stale and should
be fetched again" in the sense TanStack Query means it, so leaving these at their
HTTP-shaped defaults is not a safe default for this library.

Determined by code reading and by reading the installed `@tanstack/query-core`
defaults; the window-focus path itself was not reproduced.

## Direction

Set explicit defaults for `refetchOnWindowFocus`, `refetchOnMount`,
`refetchOnReconnect` and `retry` in `defaultQueryClientConfig`.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start in src/lib/components/NostrApp.svelte:20-24 and compare defaultQueryClientConfig with the installed @tanstack/query-core defaults described in the issue. Set explicit values for refetchOnWindowFocus, refetchOnMount, refetchOnReconnect, and retry, then verify the configuration prevents focus, mount, reconnect, and repeated retry refetches for subscription-backed queries.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
frontend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
76/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。