Archive: single-key shortcuts, density and other preferences are not exported, and a switch set off is never restored #464
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#464
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?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, comparingexport.PROFILE_FIELDSwithaccounts.Profileand round-tripping an archive on an in-memory database.Checked again on 2026-10-01 against
mainat0a5cad587: still present.The archive carries the theme, the dashboard, the navigation and the table layout, on the rule that an arrangement belongs to the account and travels with it (#123, #299). Several preferences of the same kind are left out, so a restore silently resets them to their defaults. Adding them to the export is not enough on its own: the importer skips every falsy value, so a switch the person turned off would still be restored on, and a deliberately cleared dashboard already comes back full.
core/export.py:90-111(PROFILE_FIELDS);core/importer.py:367-371inload(if hasattr(profile, name) and value:); the profile fields ataccounts/models.py:317(keyboard_shortcuts),:328(nav_underline),:340(density),:352(plugins_off),:365-368(keep_page_source,keep_page_rendering) and:407(closing_notice_days).keyboard_shortcuts,nav_underline,density,plugins_off,keep_page_source,keep_page_renderingorclosing_notice_daysappears in the archive. An account exported with shortcuts off, compact density and a ten-day closing notice came back with shortcuts on, comfortable density and three days."keyboard_shortcuts": falseadded to an archive by hand, the restored account still had shortcuts on, becausevalueis false and the importer passes over it. The same test already loses data today: an account that cleared its dashboard (dashboard_widgets: []) is restored with the seven widgets thataccounts/signals.pyseeds into every new profile.PROFILE_FIELDSand bumpFORMAT_VERSION. Inload, restore a field when its key is present (if name in PROFILE_FIELDS and hasattr(profile, name)), not when its value is truthy, and validate each value against the field (a choice fordensity, the range forclosing_notice_days, the installed plugins forplugins_off) before setting it.Done when
tests/test_export.pysets every exported profile field to a non-default value, includingkeyboard_shortcuts=Falseanddashboard_widgets=[], exports, imports into a fresh account and asserts each one survived.tiagoagueda referenced this issue2026-10-03 01:59:01 +00:00