aminghadersohi commented on code in PR #38576:
URL: https://github.com/apache/superset/pull/38576#discussion_r3482256526


##########
superset/tasks/thumbnails.py:
##########
@@ -90,6 +93,9 @@ def cache_dashboard_thumbnail(
     dashboard = Dashboard.get(dashboard_id)
     url = get_url_path("Superset.dashboard", dashboard_id_or_slug=dashboard.id)
 
+    screenshot = DashboardScreenshot(url, dashboard.digest)
+    resolved_cache_key = cache_key or screenshot.get_cache_key(window_size, 
thumb_size)

Review Comment:
   Valid catch. Moved `DashboardScreenshot(url, dashboard.digest)` and 
`resolved_cache_key` resolution inside the `override_user(user)` block in 
3d94ba2 — consistent with how `cache_chart_thumbnail` and 
`cache_dashboard_screenshot` already handle this. Without the fix, 
`dashboard.digest` evaluates under `get_current_user() = None` in Celery, 
causing all no-cache_key callers (e.g. `Dashboard.update_thumbnail`) to share 
the same fallback key.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to