Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ import { IUrlParams } from '../urlParams';
import { createInitialDataSelector } from './helpers';

const ID = 'transactionDetails';
const INITIAL_DATA = {};
Copy link
Member Author

@sorenlouv sorenlouv Nov 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This defaulted transaction to {} when the value was null. This was good in a pre-typescript world where we had to code defensively but now it just causes problems.
This was the case here:
https://github.com/elastic/kibana/blob/master/x-pack/plugins/apm/public/components/app/TransactionDetails/view.tsx#L67

Since !{} is false, the guard was never hit.

const withInitialData = createInitialDataSelector(INITIAL_DATA);

export function getTransactionDetails(state: IReduxState) {
return withInitialData(state.reactReduxRequest[ID]);
return state.reactReduxRequest[ID];
}

export function TransactionDetailsRequest({
Expand Down