Skip to content

Commit

Permalink
Fix trace detail tracking for revised redux shape
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Farro <joef@uber.com>
  • Loading branch information
tiffon committed Jul 17, 2018
1 parent 4a26cae commit b145843
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function trackParent(store: Store, action: any) {
const { spanID } = action.payload;
const traceID = st.traceTimeline.traceID;
const isHidden = st.traceTimeline.childrenHiddenIDs.has(spanID);
const span = st.trace.traces[traceID].spans.find(sp => sp.spanID === spanID);
const trace = st.trace.traces[traceID].data;
const span = trace.spans.find(sp => sp.spanID === spanID);
if (span) {
trackEvent(CATEGORY_PARENT, getToggleValue(!isHidden), span.depth);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jest.mock('../../../utils/tracking');
import DetailState from './SpanDetail/DetailState';
import * as track from './duck.track';
import { actionTypes as types } from './duck';
import { fetchedState } from '../../../constants';
import { trackEvent } from '../../../utils/tracking';

describe('middlewareHooks', () => {
Expand All @@ -30,7 +31,9 @@ describe('middlewareHooks', () => {
trace: {
traces: {
[traceID]: {
spans: [{ spanID, depth: spanDepth }],
id: traceID,
data: { spans: [{ spanID, depth: spanDepth }] },
state: fetchedState.DONE,
},
},
},
Expand Down

0 comments on commit b145843

Please sign in to comment.