mirror of
https://github.com/safijari/openpuck.git
synced 2026-11-03 22:30:22 +00:00
[PR #132] [MERGED] fix: include lizard map in backup and guard pre-lizard-mode restore #217
Labels
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
safijari/openpuck#217
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/safijari/openpuck/pull/132
Author: @Copilot
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @safijari
Base:
main← Head:copilot/fix-restoring-config-failure📝 Commits (3)
6901c7bfix: guard c.types in backup import and include lizard map in export57921dcfix: clarify c.types guard comment in importBackup7a981b9Progress bar for config import📊 Changes
1 file changed (+60 additions, -13 deletions)
View changed files
📝
docs/index.html(+60 -13)📄 Description
Two bugs in the WebUSB backup/restore path caused restoring a pre-lizard-map backup to either crash mid-import or silently drop the lizard binding map.
Bugs fixed
TypeError crash on old backups
importBackupaccessedc.types.lengthunconditionally. Backups predating per-type config don't have atypesfield →TypeErrormid-flight, after partially replaying settings but before committing bonds or mode.Lizard map silently dropped on backup/restore
The backup format never serialised
g_lizardMap. A puck with a custom lizard key/mouse map exported and reimported would silently revert to factory defaults.Changes
importBackup: Wrapc.typesloop inArray.isArray(c.types); old backups without the field now log a diagnostic and continue cleanly to bonds/commit.buildBackup: IncludelizardMapin the exported config when the puck is v16+ and the map is fully loaded.!lizardBusyguards against the lazy-load race (emptylizardBindingswould clear bindings on import).importBackup— lizard restore: After settings replay, ifc.lizardMapis present and the target firmware is v16+, replay it via the existing0x13 / 0x12×N / 0x14sequence, then drain the0xAAecho before bond writes.Backup version: Bumped to
2when a lizard map is included; stays1otherwise. All restore branches gate on field presence, not version, so all prior backup versions import cleanly.Compatibility matrix
types, nolizardMaptypes, nolizardMaptypes+lizardMaptypes+lizardMaplizardCapable()false)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.