You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Address final review comments for Windows Analytics
This commit incorporates the latest round of specific feedback on the
Windows Analytics C++ implementation (src/analytics_desktop.cc):
1. **Comment Cleanup:**
- Removed a large commented-out block that previously contained a
local `AnalyticsFn` enum definition.
- Removed a comment in `Initialize()` related to marking the `app`
parameter as unused.
- Removed an outdated comment in `Initialize()` that described the
function as a placeholder.
- Removed a type comment from the `ConvertParametersToGAParams()`
function signature.
- Replaced a lengthy comment in `LogEvent()` regarding C API object
lifecycle with a more concise one.
2. **Refined Map Parameter Processing Logic:**
- In `ConvertParametersToGAParams`, when handling a `Parameter` whose
value is a map, the logic for creating `GoogleAnalytics_Item`
objects from the map's entries has been clarified.
- A local boolean flag (`successfully_set_property`) is used for each
map entry to track if a value was successfully set in the
corresponding `GoogleAnalytics_Item`.
- A `GoogleAnalytics_Item` is only added to the `GoogleAnalytics_ItemVector`
if a property was successfully set. Otherwise, the item is destroyed.
This prevents empty or partially formed items (e.g., from map entries
with unsupported value types) from being included in the ItemVector.
LogWarning("Analytics: Value for key '%s' in map parameter '%s' has an unsupported Variant type. This key-value pair will be skipped.", key_from_map.c_str(), param.name);
0 commit comments