-
Notifications
You must be signed in to change notification settings - Fork 103
Description
change_event.changed_fields becomes undefined
after upgrading google-ads-api
past v19.0.2
Description
When querying the Google Ads API for change_event
records, prior to v19.0.2 the changed_fields
field was returned as an object with a paths
array:
{
// … other fields …
"changed_fields": {
"paths": [
"amount_micros"
]
}
}
But as soon as we upgrade to v20.0.0 (and later), the same query returns:
{
// … other fields …
"changed_fields": undefined
}
This appears to be a breaking change in the wrapper’s parsing logic, since the raw REST response still includes the changed_fields
payload when inspected via curl
or a proxy.
Steps to Reproduce
-
Pin your project to
google-ads-api@20.0.0
and execute:const result = await customer.query(` SELECT change_event.change_date_time, change_event.change_resource_name, change_event.changed_fields FROM change_event WHERE change_event.change_date_time DURING TODAY LIMIT 1 `) console.log(result[0].changed_fields) // → { paths: ["..."] }
-
Upgrade to
google-ads-api@20.0.0
:npm install google-ads-api@20.0.0
Run the same code:
console.log(result[0].changed_fields) // → undefined
-
Confirm via direct REST call that the payload still contains
changedFields
:curl -H "Authorization: Bearer <token>" \ -H "login-customer-id: <loginCustomerId>" \ -H "developer-token: <token>" \ -d '{ "query":"SELECT change_event.changed_fields FROM change_event WHERE change_event.change_date_time DURING LAST_7_DAYS" }' \ https://googleads.googleapis.com/v20/customers/<cid>/googleAds:search
The JSON response will include
"changedFields": { "paths": […] }
.
Expected Behavior
The changed_fields
property on each returned row should be a parsed object (e.g. { paths: string[] }
), matching the behavior in v19.0.2.
Actual Behavior
In v20.0.0 and later, the changed_fields
property is always undefined
, despite the REST payload containing it.