-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When deleting a parent entity (e.g., Books
), CAP correctly deletes the child entities (in this case, the Books_Attachments). However, the handler responsible for deleting the corresponding attachment in AWS is not triggered. This appears to be due to an incorrect entity path resolution.
To Reproduce
Steps to reproduce the behavior:
- Create a
Book
entity and attach files to it. - Delete the
Book
entity. - Observe that the child entities are deleted, but the AWS attachment remains.
Expected behavior
The AWS attachment linked to the deleted entity should also be removed automatically by the handler.
[ ] Is it a regression issue?
Yes, this behavior deviates from expected cleanup logic and may be a regression.
Screenshots
Please attach any relevant screenshots or logs showing the failed deletion or entity path mismatch.
Customer Info
Company: SAP
Additional Notes
- The issue seems to stem from a mismatch in entity naming conventions:
- OData service uses entity names ending with
_
- e.g. BooksOData.Books_attachments - Table definitions use
.
at it last part - e.g. sap.books.Books.attachments
- OData service uses entity names ending with
- A temporary fix was implemented in a separate branch link, but it lacks tests and is not considered a final solution.
- Suggestion: Avoid hardcoded entity names. Instead, consider using intermediary entities with aspects or compositions.
Example Entity Structure:
entity Books {
...
attachments : Composition of many BooksAttachments on attachments.book = $self;
}
entity BooksAttachments : Attachments {
task: Association to one Books;
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working