Skip to content

[Bug] Deleted tracking entity keeps reappearing after HA restart (auto-delete issue) #34

@Bjoern3D

Description

@Bjoern3D

Describe the bug

I am experiencing an issue where a specific tracking entity keeps coming back as a "ghost entity" after every Home Assistant restart, despite being deleted multiple times and having the auto-delete feature enabled.

Here is the exact behavior:

  1. After a Home Assistant restart, the tracking entity reappears and shows a "normal" state.
  2. If I manually reload the integration from the Devices & Services page, the entity state changes to "unavailable" (nicht bereitgestellt).
  3. I have tried deleting the entity permanently using the aliexpress_package_tracker.remove_tracking service in the Developer Tools, as well as deleting it directly from the integration's device overview.
  4. Despite deleting it, and despite having configured the integration to automatically remove tracking numbers 7 days after delivery, the entity always survives a complete HA restart and comes back.

It seems the tracking number is not being properly purged from the underlying storage file, causing the initialization process to pull it back in on every reboot.

Steps to reproduce

  1. Enable the setting to auto-delete packages 7 days after delivery.
  2. Attempt to delete an existing tracking entity via UI or the remove_tracking service.
  3. Restart Home Assistant completely.
  4. Notice that the deleted tracking entity is back and fully present again.
  5. Reload the integration to see it become "unavailable".

Expected behavior

When a tracking entity is deleted (either manually via the service/UI or through the 7-day auto-purge feature), it should be permanently removed from the configuration storage and must not reappear after a Home Assistant restart.

Environment details

  • Home Assistant Core Version: 2026.4.1
  • Home Assistant Operating System Version: 17.2
  • Home Assistant Supervisor Version: 2026.03.3
  • AliExpress Package Tracker Version: 2.9.1

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions