From 1676b3c87105d26bbe58753e3633348956882670 Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sun, 14 Jun 2026 14:44:25 +0200 Subject: [PATCH] fix(furni-editor): surface upsert failures and revert optimistic name on error When creating a furnidata entry for a furni whose sprite id is already used by another classname, the server rejects with ID_COLLISION. The client showed the optimistic public-name change but never reverted it, so a failed create looked like it had succeeded. On any FurniEditorResult failure, re-fetch the item detail to restore the true state (the error alert was already shown). --- src/hooks/furni-editor/useFurniEditor.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hooks/furni-editor/useFurniEditor.ts b/src/hooks/furni-editor/useFurniEditor.ts index 783de34..becc17e 100644 --- a/src/hooks/furni-editor/useFurniEditor.ts +++ b/src/hooks/furni-editor/useFurniEditor.ts @@ -190,6 +190,15 @@ export const useFurniEditor = () => { setError(parser.message || 'Operation failed'); + // updateFurnidata applies an optimistic publicName change before the + // server replies. On failure (e.g. a sprite-id collision when creating + // an entry for a variant furni) re-fetch the detail so the UI reverts + // to the true state instead of showing the name that was never applied. + if(actionItemId) + { + SendMessageComposer(new FurniEditorDetailComposer(actionItemId)); + } + if(simpleAlert) { simpleAlert(parser.message || 'Operation failed', NotificationAlertType.ALERT, null, null, 'Furni Editor Error');