Skip to content

Conversation

@danielballan
Copy link
Member

Back in July, deletion semantics were adjusted such that node.delete(...) deleted node itself (in addition to its contents). This requires a corresponding change to tiled register --prefix ... which should clear out the contents of the target node but not that node itself.

This was not caught at the time due to insufficient test coverage.

Checklist

  • Add a Changelog entry
  • Add the ticket number which this PR closes to the comment section

@danielballan danielballan changed the title Fix registration with a prefix fix: registration with a prefix Dec 17, 2025
# TODO When we have a tiled AsyncClient, use that.
await anyio.to_thread.run_sync(partial(node.delete, recursive=True))
await anyio.to_thread.run_sync(
partial(node.delete_contents, recursive=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the node that is being overwritten has internally-managed data, this will raise an error. I suppose it's the expected behavior, right?

@danielballan
Copy link
Member Author

In addition to the test, here is an interactive run:

tiled register http://localhost:8000 --api-key secret --prefix x/y/z ~/files --verbose
  Overwriting '/x/y/z'
  Walking '/home/dallan/files'
    Resolved mimetype 'image/tiff' with adapter for '/home/dallan/files/a.tif'
    Resolved mimetype 'text/csv' with adapter for '/home/dallan/files/another_table.csv'
    Resolved mimetype 'image/tiff' with adapter for '/home/dallan/files/c.tif'
    Resolved mimetype 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' with adapter for '/home/dallan/files/tables.xlsx'
    Resolved mimetype 'image/tiff' with adapter for '/home/dallan/files/b.tif'
  Walking '/home/dallan/files/more'
    Grouped 3 tiff images into a sequence 'A'
    Grouped 2 tiff images into a sequence 'B'
  Walking '/home/dallan/files/more/even_more'
    Resolved mimetype 'image/tiff' with adapter for '/home/dallan/files/more/even_more/f.tif'
    Resolved mimetype 'image/tiff' with adapter for '/home/dallan/files/more/even_more/e.tif'

@danielballan danielballan merged commit 3d22a5f into bluesky:main Dec 17, 2025
17 of 19 checks passed
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.

2 participants