Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 31, 2025

  • Initial plan: Understanding the problem and creating implementation strategy
  • Implement file deletion for adapter instances using _enumerateInstanceMeta pattern
  • Extract shared file deletion logic into _deleteFiles method
  • Refactor _deleteAdapterFiles to use shared deletion method
  • Fix JSDoc placement issue
  • Move file deletion before object deletion to ensure enumeration works
  • Generalize _enumerateAdapterMeta to accept optional instance parameter
  • Remove duplicate _enumerateInstanceMeta method
  • Update _deleteInstanceFiles to use generalized enumeration method
  • Follow existing patterns from other enumerate methods in the codebase
  • Refactor repeated template string into single variable for better maintainability
  • Add changelog entry for functional change
  • Update copilot instructions to include changelog guidance
  • Fix orphaned JSDoc comment and type annotation style

The implementation now correctly cleans up storage meta folder files when deleting adapter instances by:

  1. Using a generalized _enumerateAdapterMeta method that can handle both adapter-wide and instance-specific enumeration
  2. Following the established pattern used by other enumerate methods (_enumerateAdapterDevices, etc.) with optional instance parameter
  3. Eliminating code duplication by removing the specialized _enumerateInstanceMeta method
  4. Leveraging shared _deleteFiles method for consistent file deletion logic
  5. Extracting repeated template string logic into a single adapterPrefix variable
  6. Adding proper changelog entry describing the user-facing benefit
  7. Fixing code style issues including orphaned JSDoc and type annotations

This ensures that when instances like ical.0 or ical.1 are deleted, all associated meta files are properly cleaned up, preventing orphaned files from accumulating in the storage.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] [bug]: iob Storage Meta Folder of ical will not be deleted Fix storage meta folder cleanup when deleting adapter instances Aug 31, 2025
Copilot finished work on behalf of Apollon77 August 31, 2025 12:40
@Copilot Copilot AI requested a review from Apollon77 August 31, 2025 12:40
…back

- Fixed JSDoc placement issue (was between JSDoc and method implementation)
- Implemented _enumerateInstanceMeta method using _enumerateAdapterMeta pattern
- Created shared _deleteFiles method for file deletion logic
- Refactored _deleteAdapterFiles to use shared method
- Added _deleteInstanceFiles that uses enumeration approach instead of collectExistingFilesToDelete
- Moved file deletion call before object deletion in deleteInstance method
- Fixed TypeScript syntax and formatting issues

Co-authored-by: Apollon77 <[email protected]>
Copilot finished work on behalf of Apollon77 August 31, 2025 13:38
@Copilot Copilot AI requested a review from Apollon77 August 31, 2025 13:38
- Add optional instance parameter to _enumerateAdapterMeta method following the pattern of other enumerate methods
- Remove duplicate _enumerateInstanceMeta method
- Update _deleteInstanceFiles to use the generalized method
- Update JSDoc to document the new parameter

This follows the DRY principle and reduces code duplication as requested in review feedback.

Co-authored-by: Apollon77 <[email protected]>
Copilot finished work on behalf of Apollon77 August 31, 2025 13:55
Copy link
Collaborator

@Apollon77 Apollon77 left a comment

Choose a reason for hiding this comment

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

@copilot Additionally please add a changelog entry to the CHANGELOG.md file because this is an functional change. Please focus on the "effect" of the change and not write it too technical.

Also please add to the copilot instructions that changelog entries should be added for functional changes or enhancements.

Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot Additionally please add a changelog entry to the CHANGELOG.md file because this is an functional change. Please focus on the "effect" of the change and not write it too technical.

Also ple...

Added changelog entry focusing on the user-facing effect: "Fixed cleanup of storage meta folder files when deleting adapter instances". Also updated copilot instructions to include guidance about adding changelog entries for functional changes. e38d457

@Copilot Copilot AI requested a review from Apollon77 August 31, 2025 14:10
Copilot finished work on behalf of Apollon77 August 31, 2025 14:10
@Apollon77 Apollon77 marked this pull request as ready for review August 31, 2025 15:26
Copy link
Collaborator

@foxriver76 foxriver76 left a comment

Choose a reason for hiding this comment

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

and someone has tested this stuff..?

@Copilot Copilot AI requested a review from Apollon77 August 31, 2025 15:39
Copilot finished work on behalf of Apollon77 August 31, 2025 15:39
Copilot finished work on behalf of Apollon77 August 31, 2025 15:42
@Apollon77
Copy link
Collaborator

and someone has tested this stuff..?

No ... Wanted to check if we have such tests already and maybe task him to add tests for it :-)

It is basically just trying around ...

Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • spdx.org
    • Triggering command: node /home/REDACTED/work/ioBroker.js-controller/ioBroker.js-controller/node_modules/.bin/ts-node schemas/updateSchemas.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of Apollon77 August 31, 2025 15:53
Copy link
Collaborator

@Apollon77 Apollon77 left a comment

Choose a reason for hiding this comment

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

Not yet tested!

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.

4 participants