This is an automated email from the ASF dual-hosted git repository. michaelsmolina pushed a commit to branch 5.0 in repository https://gitbox.apache.org/repos/asf/superset.git
commit 4a189945d8d696709177bbe64b52838d972a97c4 Author: JUST.in DO IT <[email protected]> AuthorDate: Mon Mar 17 14:46:34 2025 -0700 fix(logging): missing path in event data (#32708) (cherry picked from commit cd5a94305c800171a7bb4d8d854af26db110b2f6) --- superset-frontend/src/middleware/loggerMiddleware.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/middleware/loggerMiddleware.js b/superset-frontend/src/middleware/loggerMiddleware.js index ea4160f365..a3eb629571 100644 --- a/superset-frontend/src/middleware/loggerMiddleware.js +++ b/superset-frontend/src/middleware/loggerMiddleware.js @@ -81,7 +81,9 @@ const loggerMiddleware = store => next => action => { const { eventName } = action.payload; let { eventData = {} } = action.payload; - if (dashboardInfo?.id && eventData.path?.includes('/dashboard/')) { + const path = eventData.path || window?.location?.href; + + if (dashboardInfo?.id && path?.includes('/dashboard/')) { logMetadata = { source: 'dashboard', source_id: dashboardInfo.id, @@ -95,7 +97,7 @@ const loggerMiddleware = store => next => action => { ...(explore.slice.slice_id && { slice_id: explore.slice.slice_id }), ...logMetadata, }; - } else if (eventData.path?.includes('/sqllab/')) { + } else if (path?.includes('/sqllab/')) { const editor = sqlLab.queryEditors.find( ({ id }) => id === sqlLab.tabHistory.slice(-1)[0], );
