fix: remove stale connection files from directory export when connections are deleted#1389
Open
harshithRai wants to merge 5 commits into
Open
fix: remove stale connection files from directory export when connections are deleted#1389harshithRai wants to merge 5 commits into
harshithRai wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1389 +/- ##
=======================================
Coverage 79.87% 79.87%
=======================================
Files 153 153
Lines 7060 7060
Branches 1548 1548
=======================================
Hits 5639 5639
Misses 781 781
Partials 640 640 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a stale file issue in the directory format export where connection JSON files left over from previous exports were not removed when connections were deleted from the source tenant, causing subsequent imports to treat them as desired state and skip deletion from destination tenants.
🔧 Changes
When re-exporting a tenant after social connections have been removed, the
dump()function in the directory connections handler now removes JSON files that no longer correspond to a current connection. Previously, stale files from prior exports remained in theconnections/folder, causing subsequent imports to treat those connections as desired state and never trigger their deletion from destination tenants.src/context/directory/handlers/connections.ts— updateddump()to remove stale.jsonand.htmlfiles from theconnections/directory that no longer correspond to a connection in the current exporttest/context/directory/connections.test.js— added tests covering empty connections export, partial removal of stale files, and full removal of stale files📚 References
Fixes #1376
🔬 Testing
Added two new tests to validate that:
[], enabling import to trigger deletions📝 Checklist