Conversation
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The deletion callback fix correctly normalizes PhysX event payloads, invalidates matching collections through the established lifecycle, and guarantees callback cleanup. Before merge, it should preserve the previously accepted string-path input and satisfy repository metadata requirements for the new test file and user-visible package change.
- Design and architecture: Routing matching member and root deletions through
_invalidate_initialize_callbackis coherent and ensures the root view is invalidated. However, the override previously declared and handled a plain path string; the new normalization supports event and dictionary forms but silently ignores that existing form. Supporting all three forms would retain compatibility while fixing PhysX event handling. - API: Although
_on_prim_deletionis private, its changed annotation and behavior remove the prior string-path contract without the bug fix requiring that removal. Normalize strings directly as paths in addition to extractingprim_pathfrom event and dictionary payloads. - Implementation: The prefix matching and
try/finallycleanup are internally consistent, and the regression tests cover matching, nonmatching, root, and cleanup-failure paths. Add string-input coverage, apply the repository SPDX header template to the new test module, and add the required changelog fragment for the user-visibleisaaclab_physxfix.
Minor fixes needed. Posted 3 actionable findings inline.
Automated review; human maintainers own approval decisions.
| This function is called when the prim is deleted. | ||
| This function is called when a prim is deleted. | ||
| """ | ||
| payload = getattr(event, "payload", event) if not isinstance(event, dict) else event |
There was a problem hiding this comment.
🟡 Warning · Api — String prim path input no longer handled
The replaced implementation took prim_path: str and compared it directly, so a path string was a supported input form. With a str argument the new code sets payload to the string, prim_path to "", matches_collection to False, and returns without invalidating or clearing callbacks. Accept a str path alongside event and dict payloads so both caller forms keep working.
| @@ -0,0 +1,56 @@ | |||
| from types import SimpleNamespace | |||
There was a problem hiding this comment.
🟡 Warning · Implementation — New source file missing SPDX header
Repository guidelines require the current SPDX/copyright header template on new source files. This new test module begins directly with imports. Add the same header block used by the other files under source/isaaclab_physx/test.
|
|
||
| def _on_prim_deletion(self, prim_path: str) -> None: | ||
| """Invalidates and deletes the callbacks when the prim is deleted. | ||
| def _on_prim_deletion(self, event) -> None: |
There was a problem hiding this comment.
🔵 Suggestion · Implementation — Missing changelog fragment for isaaclab_physx
Repository guidelines require one changelog fragment per changed source package for user-visible changes (or a .skip fragment otherwise). This user-visible deletion-handling fix in isaaclab_physx ships with no fragment. Add one written in past tense describing the corrected collection deletion behavior.
Description
This fixes the rigid object collection deletion callback for PhysX deletion events.
PhysX delivers a deletion event whose path is stored in
event.payload["prim_path"], but the collection override treated the event object itself as a string. Matching a member deletion could therefore fail before cleanup, leaving the collection initialized and retaining its root view.The callback now:
Fixes #7799
Type of change
Tests
git diff --checkpython -m py_compileon the modified implementation and test files.pytestand the Isaac Sim runtime are not installed).