Skip to content

Enable backup and restore of custom properties and types#2956

Open
stevelr wants to merge 1 commit intoanyproto:developfrom
stevelr:fix/restore-properties-013
Open

Enable backup and restore of custom properties and types#2956
stevelr wants to merge 1 commit intoanyproto:developfrom
stevelr:fix/restore-properties-013

Conversation

@stevelr
Copy link
Copy Markdown
Contributor

@stevelr stevelr commented Feb 16, 2026

Description

Previously, relation objects were excluded from the update path during import, which meant changes to custom relation properties (name, format, description) were silently dropped when re-importing.

Bundled relations remain protected by the existing revision guard in resetState.


  • I understand that contributing to this repository will require me to agree with the CLA

What type of PR is this? (check all applicable)

  • 🐛 Bug Fix
  • ✅ Test

Added tests?

  • 👍 yes

import, which meant changes to custom relation properties (name, format,
description) were silently dropped when re-importing.

Bundled relations remain protected by the existing revision guard
in resetState.
stevelr added a commit to stevelr/anytype-heart that referenced this pull request Feb 17, 2026
During replace/update-existing import, three issues caused incorrect
object targeting and metadata loss:

1. ID resolution matched imported clones via OldAnytypeID instead of
the original object. Prioritize direct object-ID lookup when
getExisting is true to ensure in-place replace targets the correct
object.

2. File object re-upload could hit dedup and return a different
file-object ID, bypassing state reset on the matched existing
object. Short-circuit when the existing ID is already resolved.

3. Archive/unarchive and file sync side-effects bump
lastModifiedDate. Restore the snapshot's original timestamp after
these operations. Also restore legacy file details (name, dates,
creator) for both SmartBlockTypeFile snapshots and existing
SmartBlockTypeFileObject objects during replace import.

Remove SmartBlockTypeFileObject from canUpdateObject exclusion list
so file objects participate in resetState during replace. Change
setArchived to bidirectional (archive and unarchive) and return
whether an unarchive occurred for timestamp restoration.


Note: this PR changes some of the same files as two other PRs.

Recommended merge order to minimize rebase effort:

1. anyproto#2955
2. anyproto#2956
3. This one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant