[Bug] `#save all` copies the shared rules into the character's folder, where they stop following the shared file
Maintainers usually reply within 5 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with the #save handling that passes each word to its list's save, then SaveHighlights, which writes Highlights.Rules rather than only the character's own entries. CfgFormat.HighlightLines shows why the @window suffix is lost. Done means a typed save writes only the character's entries, creates no file for a list that has none, and keeps the window in highlights.cfg. The reporter offers a fix with tests, so check with the maintainers before duplicating it.
Written by the indexing model from the issue text.
Description
What happened
I keep a few highlights in the shared Config folder so every character has them. They are limited to the Experience window. Each character also has its own folder under Profiles.
On 5.0.1-beta.1, #save all writes a file for every list into the character's folder, and each file holds every rule that is loaded, the shared ones included. From the next login the character has its own copy of each shared highlight, and the copy wins over the shared one:
- the copies are no longer limited to the Experience window, so they apply in every window;
- change a shared highlight's colour, and the character keeps the old colour;
- delete a shared highlight, and the character still has it;
- change a shared highlight's text, and the character has both the old one and the new one.
A highlight added to the shared file still arrives, until the next #save all copies that one too.
It is not only highlights. I put one shared alias, trigger, substitute, gag, shunt, macro, class and variable in Config: #save all copied each one into the character's folder, and each was still there for that character after I removed it from the shared file.
This repeats every time my script calls put #save all. I believe making copies of each shared highlight is an unintended effect, and so is a copy applying in every window when the original was limited to one.
What you expected
#save all to save what belongs to the character, and leave the shared rules where they are.
Steps to reproduce
- Have a highlight in the shared
Config/highlights.jsonthat is limited to one window, and a character whose own folder has nohighlights.cfg. - Log that character in and type
#highlight. The rule is listed with its window, for example@experience. - Type
#save all. - The character's folder now has
highlights.cfgholding the shared highlight, and a file for every other list. Most are empty. - Log out, close Genie, and change that highlight's colour in
Config/highlights.json. - Start Genie, log the character in and type
#highlight. The rule has the old colour and no window.
Environment
- OS + version: Ubuntu 26.04
- Genie 5 version: 5.0.1-beta.1
- Install type: AppImage
- Connection mode: Direct SGE
Logs / session capture
One shared highlight, as #highlight lists it:
before #save all: % +(34)\b → #FFFFFF/#800000 (Regex) @experience
next login, shared file changed to #123456: % +(34)\b → #FFFFFF/#800000 (Regex)
after deleting the character's highlights.cfg: % +(34)\b → #123456/#800000 (Regex) @experience
The character's folder before and after one #save all:
before: macros.json
after: aliases.cfg (0 bytes) classes.cfg (0) gags.cfg (0) highlights.cfg (377) macros.cfg (336)
macros.json names.cfg (0) presets.cfg (1192) shunts.cfg (0) substitutes.cfg (0)
triggers.cfg (0) variables.cfg (0)
Anything else
Cause, as far as I can read it: #save passes each word to that list's own save, as I suggested in #440, and those saves write every loaded entry. SaveHighlights writes Highlights.Rules, not only the rules that belong to the character. #highlight save typed by itself does the same on 5.0.0; #save all is what makes a script do it for every list at once.
The windows go because the line written to highlights.cfg has no place for them: CfgFormat.HighlightLines writes the pattern, colours, match type, class, sound and speak.
Workaround: none that lasts while a script sends #save all. Deleting the character's new highlights.cfg, while it holds only the copies, brings the shared highlights back at the next login, until the next #save all.
I have a fix with tests for the copying (a typed save writes the character's own entries and makes no file for a list that has none) 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
-
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
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug]: Native build script prints a traceback when Git is missing from PATHPossibly taken @Jaisuryan-web claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
KnifeLemon/Filee#1953 ·
Maintainers usually reply within 1 day