Fix vault-wide property rename semantics and metadata type bookkeeping #66
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#66
Loading…
Add table
Add a link
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?
Harden
MetadataTypeManagerproperty renames so vault-wide frontmatter updates,metadata indexes, and
types.jsonstay consistent for top-level and nestedproperties.
Context
Audit findings from the current implementation:
MetadataTypeManager.rename(prevId, newId)usesprevId.split(".")[0]to findthe tracked property and then iterates that top-level property's files. Nested
paths can miss files or rely on the wrong property index.
renameProperty()moves values with lodashget/unset/set, but there isno coverage for nested paths, collisions, falsey values, arrays, or destination
paths that already exist.
get(frontmatterData, newId)andisNil, so anexisting destination value of
nullorundefinedis treated as absent whileother falsey values rely on lodash path semantics.
types.jsonentry or clean up staleproperties/filesstate immediately.processChange()only adds file membership; it does not remove a file fromold property entries when a note changes and drops/renames a property unless a
delete event runs.
MetadataTypeManager.rename(),processChange()membership cleanup, or type-definition migration.Acceptance Criteria
the correct affected files for top-level and nested properties.
arrays/object paths, and missing files.
types.jsonare moved from the old property nameto the new name when applicable.
propertiesmembership and counts converge immediately after propertyupdate, removal, or rename without requiring a full cache rebuild.
falsey values, type migration, and property membership cleanup.
Notes
Relevant files:
packages/api/src/lib/metadata.svelte.tspackages/plugins/plugin-markdown/src/lib/components/frontmatter/frontmatter.sveltepackages/api/src/lib/file-manager.tsImplementation Summary
Hardened MetadataTypeManager rename semantics for nested and falsey values, prevented destination collisions, migrated persisted type definitions, cleaned up runtime property membership, and added focused rename/index regression tests.