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

オープン 初心者向け
#21 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

@Muneerali199 がすでに取り組んでいます。

2026年11月14日 から。

評価

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

調査の方向性

バグは src/config.ts にあります。storage オプションのドキュメントは37-40行目、storage ?? ... のフォールバックは95-98行目にあります。createWalletLinkConfig が storage を wagmi にどう渡しているかを読み、明示的な null と省略された値が区別されているかを確認してください。storage: null が ssr: false と ssr: true の両方で null を返し、テストが両方のケースを網羅していれば完了です。

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

説明

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.

主要言語
TypeScript
スター
1
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

StabilityNexus/WalletLink のほかの issue

StabilityNexus/WalletLink の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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