Repository navigation
fix(bridge): serialize Map and Set entries during inspection (#43) - #175
Merged
andykog merged 2 commits intoNov 29, 2026
Merged
Conversation
Member
|
Thanks for the contribution! |
andykog
added a commit
that referenced
this pull request
Nov 29, 2026
…e crashes found (#177) PR #175 fixed how the backend sends map and set entries, but no test opened real values in the panel. This PR adds an e2e test for that. The test opens hard-to-inspect values in the Changes tab, expands every row and compares each row with the real object in the page. It found four bugs, and this PR fixes them. ## Key changes - New playground page `inspect-fixtures`. Its test values are in `test/fixtures/trickyValues.js`: primitives, functions, class instances, MobX containers, maps with keys of any type, sets of objects, cycles and deep nesting. - New e2e test `test/e2e/inspectFixtures.js`. For each value, it checks that no uncaught error occurs and that every expand gets its inspect result. It also checks each row against the real object: map keys, set size, array indexes, object keys and primitive values. A unit test sends the same values through serialize, structured clone and deserialize. - Fix: a map key or set entry that was not a string or a number crashed the panel. The panel used it as the row name. `DataView` now shows a short label for it, for example `Point{…}`, `Symbol(key)` or `namedFn()`. - Fix: a value that contains itself, such as a map that holds itself, opened inside itself forever (React error #185). `DataItem` no longer opens a row by itself when its value is also the value of a parent row. - Fix: since the React 18 upgrade (#173), a click on a value popover or in it also toggled the log item behind it. The popover is a portal, so React click events from it reach the log item. When the log item opened, its details replaced the inspected value, and the popover showed a spinner forever. `Popover` now stops these clicks, as the popover did before #173. - Data attributes on `DataItem`, `Spinner` and the popover trigger, so that the test can find rows. They do not change behavior. - Fix: Chrome sends extension messages as JSON, so `undefined` keys disappeared, `NaN` and `Infinity` showed as `null`, and a BigInt stopped the whole message. `serialize()` now sends these values as markers, and `deserialize()` turns them back into values. The panel shows a BigInt as `10n`.
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.
Fixes #43.
Serializes \Map/\ObservableMap\ and \Set/\ObservableSet\ entries recursively inside \serialize()\ in \src/Bridge.js\ so inspected map entries clone cleanly across \window.postMessage, while updating \src/backend/utils/inspector.js\ path lookup to traverse into \symbols.entries.
Verification:
pm run test:unit\ (9 passing) and verified
pm run build:chrome\ and
pm run build:firefox.