-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Summary
When a PendingExport for CREATE or UPDATE exists for a CSO but hasn't been exported yet, and a subsequent DELETE PendingExport is created for the same object, JIM should detect this scenario and internally reconcile these PendingExports rather than exporting both operations.
Current Behaviour
Currently, if the following sequence occurs:
- PendingExport(CREATE) is created for a new object
- Before the export runs, PendingExport(DELETE) is created for the same object
Both exports would be processed in order:
- CREATE would be exported to the connected system
- DELETE would be exported to delete the object
Proposed Behaviour
JIM should detect this scenario during export execution and:
- Cancel the CREATE PendingExport (no-net-change since object never existed)
- Cancel the DELETE PendingExport (nothing to delete since object was never created)
- Audit this reconciliation so administrators can see that JIM detected and optimised away these operations
Scenarios to Handle
| Existing Export | New Export | Action |
|---|---|---|
| CREATE (pending) | DELETE | Cancel both - no net change |
| UPDATE (pending) | DELETE | Export DELETE only - object exists |
| CREATE (exported, awaiting confirmation) | DELETE | Export DELETE - object may have been created |
Audit Requirements
The reconciliation should be visible in JIM's audit/activity log:
- Record that reconciliation occurred
- Show which PendingExports were reconciled
- Explain the reason (e.g., "CREATE followed by DELETE detected - no net change")
Technical Notes
- This is a pre-export optimisation, not a confirmation mechanism
- Should run during
GetExecutableExportsAsyncor at the start of export execution - Distinct from the import-phase reconciliation implemented in PendingExport should be confirmed via import, not deleted after export #217
Acceptance Criteria
- Pending CREATE followed by pending DELETE is detected and both are cancelled
- Reconciliation is audited/logged with clear explanation
- Unit tests cover the optimisation scenarios
- Does not affect already-exported PendingExports
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request