Skip to content

Panel only shows the most recent instance when connecting after stores initialize (regression since MV3) #2053

Description

@kwonmoto

Bug

When multiple stores connect() before the devtools panel is opened, the panel shows only one instance (the most recently active one), and its name is displayed as the internal composite id (e.g. 18/3) instead of the name passed to connect().

Downstream report with screenshots: pmndrs/zustand#3461 (3 zustand stores → 1 instance shown, named "18/3").

Reproduction

  1. Build the extension from main and load it unpacked.
  2. Open a page that creates 3 connections before the panel is open, e.g. three zustand stores with devtools({ name }), or plain __REDUX_DEVTOOLS_EXTENSION__.connect({ name }) × 3.
  3. Open the devtools panel.
  4. Instance dropdown shows a single instance named like 920546649/1 instead of three named instances.

Works correctly in extension 3.1.6 (MV2).

Cause

In MV2 the panel read the background page's store directly, so it always saw every registered instance. After the MV3 migration (#1714) the panel gets state via messages, and #1771 ("Send state from background when monitor connects") added a replay in onConnect — but it replays only current (the single most recently active instance):

https://github.com/reduxjs/redux-devtools/blob/main/extension/src/background/store/apiMiddleware.ts#L593-L618

Two problems:

  1. All instances other than current are never sent to the panel.
  2. The replayed STATE request carries no name/libConfig, so the panel's instances reducer falls back to name = current — which is why users see composite ids like 18/3 as instance names.

Fix

Iterate over all registered instances in onConnect and include a libConfig (with the stored name, features, serialize) in each replayed request.

I have this implemented and verified locally (Playwright + unpacked build: before = 1 instance named 920546649/1, after = all 3 instances with correct names). Happy to open a PR.

Side note

extension/{chrome,edge,firefox}/manifest.json are still at 3.2.10 although extension/package.json is 3.2.12 — the manifest bumps appear to have been missed in the 3.2.11/3.2.12 version commits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions