upcoming: [M3-8328] - Add Analytics Events to Linode Create v2#10649
Conversation
|
Coverage Report: ✅ |
There was a problem hiding this comment.
Thanks! I confirmed sendLinodePowerOffEvent, sendApiAwarenessClickEvent, sendLinodeCreateFlowDocsClickEvent, and sendLinodeCreateEvent were still firing and the other events are no longer being tracked.
Aside from sendLinodeCreate on Clone, everything fired as expected.
packages/manager/src/features/Linodes/LinodeCreatev2/utilities.ts
Outdated
Show resolved
Hide resolved
abailly-akamai
left a comment
There was a problem hiding this comment.
Confirming seeing proper events being fired ✅
| if (type === 'Clone Linode' && values.linode) { | ||
| // @todo use Linode Query key factory when implemented | ||
| const linode = await queryClient.ensureQueryData({ | ||
| queryFn: () => getLinode(values.linode!.id), |
There was a problem hiding this comment.
can we avoid this assertion?
There was a problem hiding this comment.
I wish. Not sure why Typescript can't see the values.linode check in the if statement
There was a problem hiding this comment.
I think the type checker does not refine the type of values.linode inside the lambda function passed to queryFn.
just make it a new const
if (type === 'Clone Linode' && values.linode) {
// @todo use Linode Query key factory when implemented
const linodeId = values.linode.id;
const linode = await queryClient.ensureQueryData({
queryFn: () => getLinode(linodeId),
queryKey: ['linodes', 'linode', linodeId, 'details'],
});
sendCreateLinodeEvent('clone', values.type, {
isLinodePoweredOff: linode.status === 'offline',
});
}| export const sendCreateLinodeEvent = ( | ||
| eventAction: string, | ||
| eventLabel: string, | ||
| eventLabel: string | undefined, |
There was a problem hiding this comment.
Should we still send an event if we don't have a label?
There was a problem hiding this comment.
v1 does, so I opted to send even for undefined. I had to update the type because v1 just lied about types
Description 📝
How to test 🧪
Prerequisites
Linode Create v2feature flag 🇺🇸_satellite.setDebug(true)in your browser's console ⌨️Verification steps
As an Author I have considered 🤔