Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

The SYSBackendMethod handler was reassigning bm_class_id from the class identifier to property_ref, then using the same variable to both lookup methods in class_properties and retrieve instances from _class_mapper. This causes AttributeError because ClassMapper._map() attaches instances using class identifiers (e.g., CertCA), not property_ref values (e.g., Cert).

Changes

  • Introduced backend_class_id to retain the original class identifier for instance retrieval
  • Introduced class_properties_id to hold the property_ref for method lookup in class_properties
# Before
bm_class_id, bm_method = next(iter(bm_root.items()))
try:
    bm_class_id = class_references[bm_class_id]['property_ref']  # Loses original identifier
except KeyError as e:
    ...
getattr(getattr(self._class_mapper, bm_class_id), bm_method)()  # AttributeError

# After
bm_class_id, bm_method = next(iter(bm_root.items()))
backend_class_id = bm_class_id
class_properties_id = bm_class_id
try:
    class_properties_id = class_references[bm_class_id]['property_ref']
except KeyError as e:
    ...
getattr(getattr(self._class_mapper, backend_class_id), bm_method)()  # Correct

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Update PR to address feedback on fix for issue 39 Fix AttributeError in SYSBackendMethod by separating class identifier from property_ref Jan 25, 2026
Copilot AI requested a review from clauspruefer January 25, 2026 08:31
@clauspruefer clauspruefer deleted the copilot/sub-pr-41 branch January 25, 2026 11:35
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