[BUG]: createWalletLinkConfig silently ignores an explicit storage: null

Open Beginner friendly
#21 1 comment 0 reactions 0 assignees View on GitHub

@Muneerali199 is already working on this.

Since Nov 14, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
blockchain

Research direction

The bug is in src/config.ts: the storage option's docs are at lines 37-40, and the storage ?? ... fallback is at lines 95-98. Read how createWalletLinkConfig passes storage to wagmi, then check that an explicit null is distinguished from an omitted value. Done when storage: null yields null with both ssr: false and ssr: true, and a test covers both cases.

Written by the indexing model from the issue text.

Description

Describe the bug

createWalletLinkConfig documents that "A caller-supplied storage always wins", but the implementation uses:

storage: storage ?? (ssr ? createStorage({ storage: cookieStorage }) : undefined),

?? only falls back for null and undefined, so an explicit storage: null is treated exactly like an omitted value. In wagmi, null is meaningful: it disables persistence (CreateConfigParameters['storage'] is typed Storage | null | undefined).

Impact

A caller cannot opt out of connection persistence:

  • ssr: false + storage: null -> undefined is passed to wagmi, which falls back to its default localStorage storage.
  • ssr: true + storage: null -> cookie storage is used instead of disabling persistence.

This can persist wallet connection state in environments where the caller explicitly asked for it not to be persisted.

Evidence
  • src/config.ts:37-40 — the storage option and its docs.
  • src/config.ts:95-98 — storage ?? ....
  • node_modules/@wagmi/core/dist/types/createConfig.d.ts:13 — storage?: Storage | null | undefined.
Steps to reproduce
const config = createWalletLinkConfig({ chains: [sepolia], storage: null })
console.log(config.storage) // not null
Proposed fix

Use an explicit undefined check:

storage: storage !== undefined
  ? storage
  : (ssr ? createStorage({ storage: cookieStorage }) : undefined),

and add a test covering storage: null with both ssr: false and ssr: true.

Dominant language
TypeScript
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StabilityNexus/WalletLink

All issues in StabilityNexus/WalletLink

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.