Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Odie: fix traintracks #96622

Open robfelty opened 13 hours ago

robfelty commented 13 hours ago

In doing analysis on the Tracks events for odie sources, I noticed several issues

  1. When we fetch an existing chat, we are firing tracks events for every message in the chat. We should only fire TrainTracks events when there is a new response. The solution here is to only fire the events when there is a railcar attached to the source as part of the response from the API
  2. We were missing some valuable information in the event properties, in particular the query. This adds those in as well.

Proposed Changes

Why are these changes being made?

Testing Instructions

First, to see the issue:

Now, to see the fix:

Pre-merge Checklist

github-actions[bot] commented 13 hours ago
Calypso Live (direct link)
https://calypso.live?image=registry.a8c.com/calypso/app:build-125282
Jetpack Cloud live (direct link)
https://calypso.live?image=registry.a8c.com/calypso/app:build-125282&env=jetpack
Automattic for Agencies live (direct link)
https://calypso.live?image=registry.a8c.com/calypso/app:build-125282&env=a8c-for-agencies
matticbot commented 13 hours ago

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Async-loaded Components (~50 bytes added 📈 [gzipped])

``` name parsed_size gzip_size async-load-automattic-help-center +210 B (+0.0%) +50 B (+0.0%) ``` React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size? **Parsed Size:** Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. **Gzip Size:** Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

matticbot commented 13 hours ago

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/odie-traintracks on your sandbox.