Skip to content

Reconcile property attachments against stored names to prevent orphans on file setting removal - #269

Merged
JensVandewalle merged 2 commits into
43980_Implement-file-type-propertiesfrom
copilot/fix-code-review-suggestion
Aug 13, 2026
Merged

Reconcile property attachments against stored names to prevent orphans on file setting removal#269
JensVandewalle merged 2 commits into
43980_Implement-file-type-propertiesfrom
copilot/fix-code-review-suggestion

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

When a file setting was removed via Remove, Clear, or SetPropertySettings, its attachments could be orphaned if the setting was never tracked in RemovedFileSettings (e.g., settings for unknown/deleted property definitions that were skipped during parse).

Changes

  • SyncAttachments: Replaced the RemovedFileSettings-based orphan loop with a GetNames-based reconciliation — fetches all stored attachment names and deletes any not present in the expected set built from current FileSettings. This covers all orphan sources unconditionally, not just explicitly removed in-memory settings.

  • SyncAttachments (main loop): Removed the filesToDelete explicit deletion loop. Reconciliation already deletes any attachment absent from expectedAttachments, making the per-setting delete pass redundant and a source of double-deletion.

  • DeleteAttachments: Removed — no longer referenced.

The expected set is still derived from FileSettings[*].Files (includes pending uploads), so in-flight uploads are never incorrectly deleted and re-added settings retain their attachments.

…racking removed file settings

Co-authored-by: JensVandewalle <102030104+JensVandewalle@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code based on review comment Reconcile property attachments against stored names to prevent orphans on file setting removal Aug 12, 2026
Copilot AI requested a review from JensVandewalle August 12, 2026 15:22
@JensVandewalle
JensVandewalle marked this pull request as ready for review August 13, 2026 06:32
@JensVandewalle
JensVandewalle merged commit e25cc79 into 45799_reservation-backend Aug 13, 2026
@JensVandewalle
JensVandewalle deleted the copilot/fix-code-review-suggestion branch August 13, 2026 06:33
Copilot AI added a commit that referenced this pull request Aug 13, 2026
Co-authored-by: JensVandewalle <102030104+JensVandewalle@users.noreply.github.com>
Copilot AI mentioned this pull request Aug 13, 2026
@JensVandewalle
JensVandewalle restored the copilot/fix-code-review-suggestion branch August 13, 2026 06:43
@JensVandewalle
JensVandewalle deleted the copilot/fix-code-review-suggestion branch August 13, 2026 06:45
JensVandewalle added a commit that referenced this pull request Aug 13, 2026
Co-authored-by: JensVandewalle <102030104+JensVandewalle@users.noreply.github.com>
JensVandewalle added a commit that referenced this pull request Aug 13, 2026
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