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

Research possible ways to implement ActivityStreams extensions #36

Closed
warriordog opened this issue Jul 20, 2023 · 4 comments
Closed

Research possible ways to implement ActivityStreams extensions #36

warriordog opened this issue Jul 20, 2023 · 4 comments
Assignees
Labels
area:other Affects or applies to something that does not fit into any existing label type:research Research or design project, not direct work

Comments

@warriordog
Copy link
Owner

Extensions are a critical and actively used part of the ActivityPub spec, but they're also remarkably difficult to implement in C#. This poses a research challenge - we need to find an implementation that meets all these requirements simultaneously:

Deserialization:

  • Can extract a subset of unmapped properties from incoming JSON
  • Shape is defined by code that won't exist at library build time (but will exist when linked with user code)
  • Conversion ONLY takes place if the appropriate context is included
  • User code should not need to pass around multiple objects. That is, extension data must be directly linked to the base object type.
  • Properties may be remapped at runtime by an alias in an inline or external context. currently out of scope - will be handled in a separate issue
  • Property values can be remapped by an extension. currently out of scope - will be handled in a separate issue

Serialization:

  • Extensions must be linked to and serialized along with the base object - users should not need to make multiple calls
  • Extension context must be promoted to @context property
  • Multiple extensions may define overlapping properties, and they must be aliased or expanded to resolve conflicts.

For more information, see previous discussions in #2.

@warriordog warriordog added help wanted Extra attention is needed area:other Affects or applies to something that does not fit into any existing label labels Jul 20, 2023
@warriordog warriordog self-assigned this Jul 20, 2023
@warriordog
Copy link
Owner Author

This is the most viable solution so far: #2 (comment)

@warriordog
Copy link
Owner Author

This is the most viable solution so far: #2 (comment)

Expansion of this - register extensions at runtime (like the types). Then we can remove the JSON properties and make the extension map read-only. Much safer!

@warriordog
Copy link
Owner Author

We should wait until #39 is done - the implementation for that will impact this. Extension types would be more natural if integrated through that system. Will probably need to integrate @context into the type resolution process.

@warriordog warriordog added the status:blocked This issue cannot be completed due to an external conflict or blocker label Jul 29, 2023
@warriordog warriordog modified the milestones: ActivityStreams: mimimum viable support, Version 0.1.0, Version 1.0.0 Jul 29, 2023
@warriordog warriordog added the type:research Research or design project, not direct work label Jul 29, 2023
@warriordog
Copy link
Owner Author

TypeMap seems to be the best solution so far. Closing in favor of #71.

@warriordog warriordog removed help wanted Extra attention is needed status:blocked This issue cannot be completed due to an external conflict or blocker labels Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:other Affects or applies to something that does not fit into any existing label type:research Research or design project, not direct work
Projects
No open projects
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant