Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix traceAtCursor missing traces in VirtualContexts #714

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions dbux-data/src/dataProviderUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -1657,11 +1657,11 @@ export default {

/** @param {DataProvider} dp */
getRealStaticContextIdOfStaticContext(dp, staticContextId) {
const { parentId, type } = dp.collections.staticContexts.getById(staticContextId);
const { parentId } = dp.collections.staticContexts.getById(staticContextId);

// NOTE: "first virtual" context of context is "real context"

if (!isVirtualStaticContextType(type)) {
if (dp.util.isRealStaticContext(staticContextId)) {
return staticContextId;
}

Expand All @@ -1686,6 +1686,20 @@ export default {
// return realContext.staticContextId;
},

/** @param {DataProvider} dp */
isRealStaticContext(dp, staticContextId) {
const staticContext = dp.collections.staticContexts.getById(staticContextId);
if (!isVirtualStaticContextType(staticContext.type)) {
return true;
}
else if (staticContext.isInterruptable) {
// `isInterruptable === true` for the first virtual context
return true;
}

return false;
},

/** @param {DataProvider} dp */
getRealContextIdOfTrace(dp, traceId) {
const { contextId } = dp.collections.traces.getById(traceId);
Expand Down
3 changes: 1 addition & 2 deletions dbux-data/src/impl/indexes/TracesByRealStaticContextIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default class TracesByRealStaticContextIndex extends CollectionIndex {
*/
makeKey(dp, trace) {
const { contextId } = trace;
const { staticContextId } = dp.collections.executionContexts.getById(contextId);
const realContextId = dp.util.getRealStaticContextIdOfStaticContext(staticContextId);
const realContextId = dp.util.getRealStaticContextIdOfContext(contextId);

return realContextId || 0;
}
Expand Down