Skip to content

fix: fallback to references when object not found by id#56

Open
SilverRainZ wants to merge 1 commit intomasterfrom
fix/pending-object-resolve
Open

fix: fallback to references when object not found by id#56
SilverRainZ wants to merge 1 commit intomasterfrom
fix/pending-object-resolve

Conversation

@SilverRainZ
Copy link
Member

Summary

When resolving a PendingObject, if the object is not found by (objtype, objid) in objects, fallback to searching references to find the object.

Changes

  • Modified PendingObject.resolve() in domain.py to:

    1. First try to find object by (objtype, objid) in objects
    2. If not found, search references using (objtype, _, objid) pattern
    3. Use the found objid to retrieve the object
  • Added unit tests in tests/test_domain.py covering:

    • Resolving by ID
    • Resolving by reference
    • Multiple references
    • Not found scenario

Co-authored-by: MiniMax-M2.1 minimax-cn-coding-plan@users.noreply.github.com
Co-authored-by: opencode opencode@users.noreply.github.com

When resolving a PendingObject, if the object is not found by (objtype, objid),
fallback to searching references to find the object.

Co-authored-by: MiniMax-M2.1 <minimax-cn-coding-plan@users.noreply.github.com>
Co-authored-by: opencode <opencode@users.noreply.github.com>
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.

1 participant