This is an automated email from the ASF dual-hosted git repository.
justinpark pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new cd5a94305c fix(logging): missing path in event data (#32708)
cd5a94305c is described below
commit cd5a94305c800171a7bb4d8d854af26db110b2f6
Author: JUST.in DO IT <[email protected]>
AuthorDate: Mon Mar 17 14:46:34 2025 -0700
fix(logging): missing path in event data (#32708)
---
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],
);