[Bug] After `#save all`, disabled triggers, highlights, gags and aliases are enabled again at the next start

Open
#460 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 5 days

@syntaki is already working on this.

Since Dec 1, 2026.

  • #465 by @syntaki — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with CommandEngine.WriteProfileCfg, CfgFormat.TriggerLines, LayeredRuleLoad.BuildEffectiveScope, and ConfigurationViewModel.SyncCfgAt to trace how the .cfg and .json rule layers overwrite each other. Add or update tests around saving triggers, highlights, gags, aliases, and highlight windows. The fix is done when saving does not create a competing .cfg for a list already present as .json, and disabled rules remain disabled after restart.

Written by the indexing model from the issue text.

Description

bug

What happened

On 5.0.1-beta.4, a trigger I turned off in Edit ▸ Configuration is on again at the next start once #save all has run, and it fires. After that, turning it off in the Configuration window only lasts until the next start. Disabled highlights, gags and aliases come back enabled the same way, and a highlight limited to one window loses the window.

Scripts written for Genie 4 often call put #save all when they start, so this happens without anything being typed.

What you expected

A rule should stay the way the Configuration window saved it. #save all should not turn it back on.

Steps to reproduce

  1. Start Genie (no connection needed). Edit ▸ Configuration…, Triggers tab: Pattern savetest, Action #echo fired, untick Enabled, Save, Close.
  2. Type #trigger, then #parse savetest. The trigger is listed as (disabled) and nothing fires.
  3. Type #save all, then restart Genie.
  4. Type #trigger, then #parse savetest. The trigger is listed without (disabled) and fired is printed.
  5. Select the trigger in the Configuration window, click Toggle so it is off again, and restart Genie. It is on again.

Without the #save all the trigger is still disabled after a restart. A character's own rules in its profile folder behave the same. The shared ones are left alone, so that part of #446 is fixed.

Environment

  • OS + version: Ubuntu 26.04
  • Genie 5 version: 5.0.1-beta.4
  • Install type: AppImage
  • Connection mode: not connected (the steps need no connection)

Logs / session capture

Step 2:

Triggers:
savetest → #echo fired (disabled)

Step 4:

Triggers:
savetest → #echo fired
fired
fired

fired comes twice. I assume the typed line counts as a match too.

Anything else

Cause, as far as I can read it:

  • #save all writes a triggers.cfg beside a triggers.json that had none (CommandEngine.WriteProfileCfg). Its line is #trigger add {savetest} {#echo fired} {} {} {}: a .cfg line has no place for Enabled (CfgFormat.TriggerLines; the highlight, gag and alias lines are the same, and a highlight's also leaves out its windows). triggers.json still says "IsEnabled": false.
  • When both files are there the .cfg wins: LayeredRuleLoad.BuildEffectiveScope reads the .json and then replays the .cfg, whose loader clears the list first. The Configuration window rewrites an existing .cfg at every save (ConfigurationViewModel.SyncCfgAt), so its own change is lost too.
  • 5.0.0 does the same after #trigger save. New in 5.0.1 is #save all, which scripts call by themselves.

The same is true of main as of d54992d.

Workaround: close Genie and delete the .cfg that #save all made beside the .json of the same name (triggers.cfg here).

I have a fix with tests (a typed save writes no .cfg for a list the folder's .json already holds) and can open a pull request if that is welcome.

Dominant language
C#
Stars
2
Forks
5
Avg merge
4d 3h
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenieClient/Genie5

All issues in GenieClient/Genie5

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.