mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-17 10:03:08 +00:00
Fix event hooks not persisting across server syncs (#799)
* Changes from fix/event-hook-persistence * feat: Add explicit permission escape hatch for clearing eventHooks and improve error handling in UI
This commit is contained in:
@@ -573,6 +573,17 @@ export class SettingsService {
|
||||
ignoreEmptyArrayOverwrite('claudeApiProfiles');
|
||||
// Note: claudeCompatibleProviders intentionally NOT guarded - users should be able to delete all providers
|
||||
|
||||
// Check for explicit permission to clear eventHooks (escape hatch for intentional clearing)
|
||||
const allowEmptyEventHooks =
|
||||
(sanitizedUpdates as Record<string, unknown>).__allowEmptyEventHooks === true;
|
||||
// Remove the flag so it doesn't get persisted
|
||||
delete (sanitizedUpdates as Record<string, unknown>).__allowEmptyEventHooks;
|
||||
|
||||
// Only guard eventHooks if explicit permission wasn't granted
|
||||
if (!allowEmptyEventHooks) {
|
||||
ignoreEmptyArrayOverwrite('eventHooks');
|
||||
}
|
||||
|
||||
// Empty object overwrite guard
|
||||
const ignoreEmptyObjectOverwrite = <K extends keyof GlobalSettings>(key: K): void => {
|
||||
const nextVal = sanitizedUpdates[key] as unknown;
|
||||
|
||||
Reference in New Issue
Block a user