fix: more small call graph and call stack and more things
- Dominant language
- JavaScript
- Stars
- 171
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
# TODO
* [ ] revamp async update logic in ACG:
* Only use `setState` to send render data to client. Refrain from directly calling client code remotely.
* E.g. in [host/AsyncGraph](https://github.com/Domiii/dbux/blob/89d4f47312d2f66fbcc6f48e77168f5bd450968e/dbux-graph-host/src/graph/asyncGraph/AsyncGraph.js), there should not be all kinds of `this.remote` calls.
* [ ] Optimize ACG: in `update()` use the "delta update" approach
* → divide node data into three groups `added`, `removed`, `remaining`, and handle them correspondingly
* We already implement that logic in `KeyedComponentSet`. Try to re-use that.
# Done
## Misc
* [x] fix: `_getNestedAncestors` is incorrect
* It reports an infinite loop that does not actually exist: promiseId `v4292` at rootId `c1373`
* [x] sometimes, when selecting `x` in `await x`, it will not let user select `x`, but always selects `await x` instead
* → Seems to be a general issue with the **first** `await` of any `async` function
* test w/ `async/basic1.js` → try selecting RHS of first `await` of `main`
* test w/ `sequelize#2` → `sequelize.js:613` → try selecting RHS of the `await`
* [x] VSCode keeps crashing when selecting certain ACG nodes
* First set a breakpoint on ACG node selection code, then repro. Be careful. It **will** crash your VSCode (extension host window)
* Repro steps
* open ACG in `follow` mode
* select `result2` in `index.tsx`
* NOTE: this also happens if you take the steps in reverse.
* [x] subsequent (not first) roots of `async` functions don't have `Root Promise` set
* see `TraceDetails` → `Async` → `Root Promise`
* test w/ `await2.js`
* [x] fix: `GlobalView` → `Errors` are not sorted by timestamp
* [x] fix: SCG `HoleNode` root extension does not work. Sometimes, it would produce multiple sibling `HoleNodes`.
* However, only one of them is real. The other ones disappear when refreshing.
* Test w/ a whole bunch of `await sleep`s (causing many CGRs)
* [x] fix: sometimes there is an inf loop in `_getNestedAncestors`
* → added `visited` set to avoid inf loop, in case promises chain back on themselves.
## ACS
* [x] test w/ `sequelize#2`
* select the 4th error (actual reported error)
* [x] The stack only goes full width after also clicking the CG buttons.
* [x] Afterwards, the CG button is still shown as active
* [x] make sure that all CGRs are captured accurately
* `executeSql()` is displayed as a CGR but it is not a CGR.
* It's actual CGR shows up after clicking into it.
* [x] when clicking `await` (as caller), make sure it jumps to the correct place:
* → the `Await` context location of that `await` (which is located right behind the await)
* [x] sometimes, ACS collapse/expand buttons don't work
* is that because those contexts have been moved to a different place? should we just hide the buttons for contexts whose children have been moved then?
* temporarily hide graph mode buttons in ACS
## ACG
* [x] `val` button does not work if: (1) first select a trace, (2) then enable `val`
* [x] selected node does not stay selected: (1) select trace, (2) toggle `detail` mode
* [x] also test all of these in SCG
## CG Filtering
* [x] fix: when unselecting and re-selecting the application, all `HoleNodes` are gone.
* [x] fix: defaults seem wrong?
* in `express#1`, it shows everything by default
* it also claims to have an active blacklist.
* make sure it feels **smooth** when using it:
* the buttons should be `active` iff the filter is active
* and using the buttons should always work exactly as intended and feel intuitive (if possible 🤣)
* 
## Other
* [x] small fixes for https://github.com/Domiii/dbux/pull/704
* [x] in `BaseTreeViewNodeProvider.refresh` and any `focus*` methods (e.g. `focusOnSearchResult`):
* can we add `if (!this.treeView.visible) { return; }` at the beginning?
* [x] Can we add some general buttons to the `viewContainer/title`, and/or can they be always visible?
* Currently, buttons are only shown when hovering over something. There is a good chance that that will be very confusing to users.
* → Probably not.
* It was once proposed but have been closed, see [#90268](https://github.com/microsoft/vscode/issues/90268)
* Discussion online: https://stackoverflow.com/questions/71644360/add-a-button-to-viewcontainer-that-is-always-visible-in-vscode-extension
## Search
* [x] when re-selecting application, not everything seems to get updated correctly
* [x] empty search field should always reset the search. ENTER should not start a search for an empty string.
* [x] when clicking a button, the dropdown stays open
## Data Flow
* [x] fix: when selecting `x` in `class A { f(x) {} }; new A().f(1);`: in `DataFlow View`, it renders the entire class
* → should only show the parameter instead
* [x] fix: array built-in HOF parameter linkage (`map`, `filter`, `some` etc.)
* [x] test w/ `json-parse1.js`
* → this should work in both, `Value` and `Access` modes
* Ideal Solution
* → add corresponding `DataNodes` in `ValueCollection`
* → re-do the order of calls: call `dataNodeCollection.createRefDataNode(value, parentNodeId, propValue, refId)` from `_serialize`
* → but this might cause a big impact on performance for rarely needed pieces of information
* → try hackfixing `buildDataNodes` or `getValueId` instead
Contributor guide
Assessment
This issue has not been assessed yet.