Skip to content
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

Support deserialization of sub-trees and not just entire partitions #145

Closed
ftomassetti opened this issue Mar 21, 2024 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ftomassetti
Copy link
Contributor

I think this should be changed to support deserializing subtrees:

const serializedRootNodes = serializedNodes.filter(({parent}) => parent === null)

We recently encountered the very same problem in lioncore-java where we had the same logic. The problem is that in this way we are only able to deserialize entire partitions, but nothing below them.

See LionWeb-io/lionweb-java#132 for comparison

@dslmeinte
Copy link
Contributor

So, we should

  • Construct nodes from all serialized nodes
  • Resolve references
  • Return those nodes that have parent null or an unresolvable parent

?

@ftomassetti
Copy link
Contributor Author

Yes, I would do that.
In Java we can define the three options:

  • Throw exception if there is any parent we cannot solve (but that means that either we ask only for entire partitions or we have another mechanism to solve nodes, for example because we already have on the client side)
  • Set them to null
  • Use sort of purely working proxies

Of these, I think that the only option that makes sense in most cases is setting the parent to null

@dslmeinte
Copy link
Contributor

At this point, I wouldn't really do anything too configurable in the TS-space, so I'd simply set things to null.

@dslmeinte dslmeinte self-assigned this Mar 22, 2024
@dslmeinte dslmeinte added the bug Something isn't working label Mar 27, 2024
@dslmeinte
Copy link
Contributor

Fixed by PR #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants