sadpandajoe commented on code in PR #43666:
URL: https://github.com/apache/superset/pull/43666#discussion_r3890336418


##########
superset/commands/dashboard/update.py:
##########
@@ -130,6 +131,19 @@ def validate(self) -> None:
         except ValidationError as ex:
             exceptions.append(ex)
 
+        # A dashboard PUT resends the full object on every save, so only
+        # validate css when it's actually changing -- otherwise a dashboard
+        # whose existing css predates this check (or was imported without
+        # going through it) becomes uneditable for unrelated changes like a
+        # rename or a chart move.
+        if "css" in self._properties:
+            new_css = self._properties["css"]

Review Comment:
   This changes the previous behavior for concurrent saves: before this change, 
the PUT schema rejected a stale `@import` value before the command ran. Now 
request A can read that value, skip this check because it matches its stale 
model, request B can replace it with safe CSS, and A can subsequently write its 
stale payload and restore the unsafe CSS. Could the exemption be conditioned on 
the persisted value at write time, or the update be serialized, so a concurrent 
cleanup cannot be undone?



-- 
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