An imported character sheet's rules link by name, and no id from a file is stored (export schema 20) (#1095) #1101
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/1095-sheet-rows-relink"
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?
Closes #1095.
The facts first
A sheet holds a rules record's ids in four places, not one. All are JSON; all were exported and stored as they were.
entries[].refresolve_entriesand the evaluator: the only place a sheet is worked out fromresources.conditions.<slug>.refnameis useddatanamesource_ref(what was picked at creation and at each level)resolve_entriesbuilds its map keyed by the storedentry_id, and the evaluator looks up by the same stored value, so the two agree whatever id is stored.Summary
rule_ref(pack key, kind, slug) beside what remains.pack_idandentry_id, or both are cleared and the row stands on its own snapshot.rule_refis never stored.entry_idandpack_iddropped in all four places.name,slug,kindand the snapshot are kept.rule_linkssummary. Conditions and kept choices are linked without being counted. No sentence on the result screen changed.What changes for someone
Not done
_usableguards every read, and a test proves it) and are not cleaned up; that would need a data migration.Changelog
changelog.d/1095-sheet-rows-relink.fixed.mdTest plan
8001 passed, 14 skipped, 107 deselected.tests/export/test_export_sheet_links.py, 17 cases:ImportCampaignForm,src/pages/sheet,src/sheets:720 passed; eslint 0 errors. Two earlier runs timed out in 16 and 11 different tests at a host load over 20; the clean run was at about 8.🤖 Generated with Claude Code