fix: clear stale mesh v2 domain from localStorage when modal opens#328
Merged
takaokouji merged 3 commits intodevelopfrom Mar 17, 2026
Merged
fix: clear stale mesh v2 domain from localStorage when modal opens#328takaokouji merged 3 commits intodevelopfrom
takaokouji merged 3 commits intodevelopfrom
Conversation
When users previously entered a domain manually, it was cached in localStorage. On subsequent sessions without domain input, the stale cached value was silently used instead of auto-detecting via createDomain(), causing devices on the same network to get different domains and be unable to find each other's mesh groups. Reset Redux meshV2 domain to null when the connection modal opens, and clear the extension domain when the user clicks Create/Join without entering a domain. Fixes #327 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Verify Redux domain is reset to null when meshV2 modal opens - Verify domain is NOT reset when already connected - Verify phase is meshV2Initial when domain is empty Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🚀 Preview deployed: https://smalruby.jp/smalruby3-editor/fix/mesh-v2-stale-domain-cache/ |
…open The previous approach reset Redux domain to null when the modal opened, which cleared explicitly-entered domains on reload. Instead, track whether the user changed the domain input during the current modal session. Only clear the cached domain when the user did not explicitly change it, preserving intentionally-set domains across reloads. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-actions bot
pushed a commit
that referenced
this pull request
Mar 17, 2026
…tale-domain-cache fix: clear stale mesh v2 domain from localStorage when modal opens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createDomain()によるIP自動検出が正しく動作するようにしたChanges Made
根本原因
saveDomainToLocalStorage()でキャッシュgetDomainFromLocalStorage()が古い値を返すsyncMeshV2Domain()がReduxにも古い値を同期createDomain()が呼ばれない修正内容
connection-modal.jsx: meshV2モーダルを開く時にRedux domainをnullにリセット(ドメイン入力欄を空で表示)connection-modal.jsx: 「ホストになる」「参加する」クリック時にdomainが空ならextension.setDomain(null)でlocalStorageをクリア →createDomain()によるIP自動検出が行われるTest Coverage
Related Issues
Fixes #327