[Bug] After `#save all`, disabled triggers, highlights, gags and aliases are enabled again at the next start
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
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
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
- Start Genie (no connection needed). Edit ▸ Configuration…, Triggers tab: Pattern
savetest, Action#echo fired, untick Enabled, Save, Close. - Type
#trigger, then#parse savetest. The trigger is listed as(disabled)and nothing fires. - Type
#save all, then restart Genie. - Type
#trigger, then#parse savetest. The trigger is listed without(disabled)andfiredis printed. - 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 allwrites atriggers.cfgbeside atriggers.jsonthat had none (CommandEngine.WriteProfileCfg). Its line is#trigger add {savetest} {#echo fired} {} {} {}: a.cfgline 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.jsonstill says"IsEnabled": false.- When both files are there the
.cfgwins:LayeredRuleLoad.BuildEffectiveScopereads the.jsonand then replays the.cfg, whose loader clears the list first. The Configuration window rewrites an existing.cfgat 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GenieClient/Genie5
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
GenieClient/Genie5#496 ·
Maintainers usually reply within 5 days
-
enhancement g4-regression
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
GenieClient/Genie5#494 ·
Maintainers usually reply within 5 days
-
area:ui-dock enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GenieClient/Genie5#462 ·
Maintainers usually reply within 5 days
-
area:mapper bug est:<1d P2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
GenieClient/Genie5#449 · 1 comment ·
Maintainers usually reply within 5 days
-
[Bug] Maps ▸ Update from Official Repo / Repair Maps give no notification of success or failurePossibly taken A pull request linked to this issue is open or already merged. Openarea:mapper area:updater bug est:<1d P3
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
GenieClient/Genie5#423 · 1 assignee ·
Maintainers usually reply within 5 days
All issues in GenieClient/Genie5
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SubtitleEdit/subtitleedit#17351 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
elsa-workflows/elsa-foundation#6384 ·
Maintainers usually reply within 1 day
-
documentation good first issue kind:task level:starter size:s
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Arggon/ArggonStores#66 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Tool] MockAPIOpenhas-image has-license has-readme new-tool ready-to-approve repo-verified
Difficulty 1/5 Under an hour Newbie friendliness 72/100
shanselman/TinyToolTown#956 ·
Maintainers usually reply within 2 days