sadpandajoe commented on code in PR #45649:
URL: https://github.com/apache/superset/pull/45649#discussion_r4383887612
##########
superset-frontend/src/features/semanticLayers/SemanticLayerModal.tsx:
##########
@@ -333,32 +370,41 @@ export default function SemanticLayerModal({
};
const handleCreate = async () => {
+ saveRequestRef.current += 1;
+ const request = saveRequestRef.current;
setSaving(true);
try {
if (isEditMode && semanticLayerUuid) {
await SupersetClient.put({
endpoint: `/api/v1/semantic_layer/${semanticLayerUuid}`,
jsonPayload: { name, configuration: formData },
});
+ if (request !== saveRequestRef.current) return;
Review Comment:
In edit mode, if a user clicks Save and then cancels before the PUT returns,
the unmount/close cleanup bumps `saveRequestRef`, so this early return skips
`onHide()` after the update actually succeeds. `DatabaseList` keeps this modal
mounted and does its `refreshData()` in `onHide`, so the Connections list stays
on the old name (the refresh fired by the cancel ran before the PUT committed)
until the next manual reload. Create mode already notifies the parent through
`onCreated` before the stale check; could the edit branch signal the parent the
same way (or call a refresh) before returning?
--
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]