Skip to content

fix: CallDeferred with SkeletonInstance #1518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ArneGudermann
Copy link
Contributor

Fix for #1390

@ArneGudermann ArneGudermann changed the base branch from main to develop July 10, 2025 15:14
Copy link
Member

@phorward phorward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also stumbled across this about a year ago and decided at the time that this problem could not be solved.

It's precisely about these edge cases: What if, for example, a subskel or even ActionSkel with a different bone order is put in here? Then there is no child and a skeletonByKind also fails.

I would therefore like to open this topic for discussion.

Comment on lines +50 to +52
data = obj.dbEntity
if data is None:
data ={}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data = obj.dbEntity
if data is None:
data ={}
data = obj.dbEntity or {}

if data is None:
data ={}
return {
".__entity__": ViURJsonEncoder.preprocess(dict(data)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db.Entity inherits from dict. I think this is obsolete, but please test.

Suggested change
".__entity__": ViURJsonEncoder.preprocess(dict(data)),
".__entity__": ViURJsonEncoder.preprocess(data),

@@ -80,6 +87,15 @@ def _decode_object_hook(obj: t.Any):
entity = db.Entity(db.Key.from_legacy_urlsafe(obj[".__key__"]) if obj[".__key__"] else None)
entity.update(obj[".__entity__"])
return entity
elif len(obj) == 3 and all(k in obj for k in (".__entity__", ".__key__", ".__skel__")):
from viur.core.skeleton.utils import skeletonByKind
skel = skeletonByKind(obj[".__skel__"])()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if a subskel of a given kind was provided? This won't work.

@phorward phorward added the viur-meeting Issues to discuss in the next ViUR meeting label Jul 10, 2025
@phorward phorward added this to the ViUR-core v3.9 milestone Jul 14, 2025
@phorward phorward added the feature New feature or request label Jul 21, 2025
@phorward phorward removed the viur-meeting Issues to discuss in the next ViUR meeting label Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants