akiomik / akiomik/nosvelte

queryClientConfig is merged shallowly, dropping NostrApp's own defaults

Open
#76 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
29
Forks
3
Avg merge
3h 5m
Merged PRs (30d)
11

Description

`NostrApp` merges the caller's config with a shallow spread
(`src/lib/components/NostrApp.svelte:31`):

```ts
$: mergedQueryClientConfig = { ...defaultQueryClientConfig, ...queryClientConfig };
```

`defaultOptions` is a single key, so any caller that passes

```svelte

```

replaces the whole `defaultOptions` object and silently loses nosvelte's
`staleTime` and `refetchInterval`.

Every test in this repository passes exactly that shape, which is why the
interaction between the library's defaults and a caller-supplied config is
currently untested.

Determined by code reading.

## Direction

Merge `defaultOptions.queries` (and the sibling option groups) rather than
`defaultOptions` as a whole.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.