Repository navigation
Bug Found. Shift layer is wiped on save/reload if the profile is still active when PadForge closes #375
|
I've encountered what I assume to be a bug when it comes down to saving any layer created on a profile. SummaryLayers created on a profile appear to be lost after closing and reopening PadForge — but only if that profile is still the active profile at the time of closing. If you switch to a different profile (e.g. the Default profile) before closing, the layer persists correctly. Versions Tested
Tested on multiple computers, just in case. Steps to Reproduce
Note: switching to the Default profile before closing (steps 13–14) is not required to trigger the bug — it's only included above to show that the layer does save correctly under the right conditions. The bug reproduces even if you skip straight from step 12 to closing PadForge with "New Profile" still loaded. Expected BehaviorThe shift layer should persist regardless of which profile is active when PadForge is closed. Actual BehaviorThe shift layer is wiped if the profile it belongs to is still active/loaded when PadForge closes. Switching away to another profile first avoids the issue. |
Replies: 1 comment 1 reply
|
@brawler14801 Found, fixed, and shipped today. Issue #376 has the full trace, and the fix is in the next build. Your repro was exemplary and it reproduced exactly as written, down to the switching-away escape hatch. The mechanism: on startup, PadForge runs a guard that clears mapping data for slots that no longer exist. That guard ran at a moment when the app had restored the DEFAULT profile's slot layout but not yet your active profile's, so with your profile active at close, the slots only it owns looked nonexistent and the guard wiped their mapping sets, shift layers included. The next background save then wrote the wiped state into your stored profile, which is why the layer never came back. Your two observations pinned it: switching away first survives because the restart then judges against the default's own layout, and loading the profile afterward restores its stored copy. The reason the shift layer was the visible victim is that automap quietly rebuilds the mapping rows for a connected controller, and nothing rebuilds a shift layer. The guard now runs after your active profile's layout is applied, so it judges against the layout that is actually live. Your exact steps are replayed by four automated tests through the real save and load code, the failing one was red before the fix and green after, and the whole flow was also verified end to end with the real app: a file carrying the layer survived a restart with the profile active, a normal close, and a second restart, where the pre-fix build wiped it in one. One honest note: the bug destroys the stored data, so a layer already lost to it needs re-authoring once. From the fixed build forward it persists no matter which profile is active when you close. Thanks for the best-written report this tracker has seen, and for the external-control idea last week. You have a knack for finding exactly the seams. |
@brawler14801 Found, fixed, and shipped today. Issue #376 has the full trace, and the fix is in the next build.
Your repro was exemplary and it reproduced exactly as written, down to the switching-away escape hatch. The mechanism: on startup, PadForge runs a guard that clears mapping data for slots that no longer exist. That guard ran at a moment when the app had restored the DEFAULT profile's slot layout but not yet your active profile's, so with your profile active at close, the slots only it owns looked nonexistent and the guard wiped their mapping sets, shift layers included. The next background save then wrote the wiped state into your stored profile, which is why the layer never cam…