Deleting a config checkpoint breaks the checkpoint storage

Created on 24 April 2025, about 1 month ago

Problem/Motivation

Deleting a checkpoint deletes all checkpoints up to the checkpoint asked to be deleted.
But checkpoints have a reference to their parent and when checkpoints are deleted the now oldest checkpoint has its parent still set to the deleted one instead of null.
This creates a whole bunch of problems, for example one can not get parents and thus also not add a new checkpoint to the storage.

Steps to reproduce

create more than one checkpoint, delete any except the current one. Try to add a new checkpoint or get parents.

Proposed resolution

fix the delete method

Remaining tasks

write patch

User interface changes

none

Introduced terminology

none

API changes

none

Data model changes

none

Release notes snippet

-

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

configuration system

Created by

πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bircher
  • Pipeline finished with Canceled
    about 1 month ago
    Total: 189s
    #481580
  • Pipeline finished with Failed
    about 1 month ago
    Total: 181s
    #481583
  • Pipeline finished with Failed
    about 1 month ago
    Total: 178s
    #481590
  • Pipeline finished with Success
    about 1 month ago
    Total: 529s
    #490194
  • Pipeline finished with Failed
    about 1 month ago
    Total: 129s
    #490226
  • Pipeline finished with Success
    about 1 month ago
    Total: 401s
    #490237
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    Ok, so I went back and first fixed the test to use a real state object instead of a prophesised one. It passed nicely.
    Then I expanded the test coverage to get parents, and it failed.
    Then I reapplied the fix to the linear histroy and the tests passed again.

    So this is now ready for review.

  • Pipeline finished with Success
    about 1 month ago
    #490321
  • πŸ‡ΊπŸ‡ΈUnited States sonfd Portland, ME

    I am not familiar enough with this API to RTBC, but the updated delete logic looks good to me. And so does the new test logic.

    But since deleting a checkpoint currently results in a broken state, should we also add an update hook to fix the broken state on existing sites?

  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    I don't think we need an update hook. There is currently no way to delete a checkpoint other than directly using the API. And since it makes all furter interactions impossible except for deleting all the checkpoints, anyone who would have encountered this bug would have solved it by just deleting all checkpoints.

    Don't be shy! call the api manually, or just intall config_checkpoint_ui β†’ and comment out the unset of the delete operation and observe that you can no longer create new checkpoints, then you fix core with this patch and see how everything works as expected.

Production build 0.71.5 2024