Home | Notifications | New Note | Local | Federated | Search | Logout

Note Detail


Reply to @silverpill@mitra.social
grindhold@grindhold@23.social (2026-06-13 20:20:30)
@silverpill @sabrinkmann @Profpatsch 

the biggest problem with the duck typing approach imo is, that there might occur situations in which different definitions exist for the same field.

e.g. we had this situation where content was defined as a Proposal as string, whereas in Note it was common to have a mapping from lang-code to a string in the according language as content.

In this case we could figure it out but there might be more complicated cases and not every type might end up mixable
---Reply--- grindhold@grindhold@23.social (2026-06-13 20:23:12) @silverpill @sabrinkmann @Profpatsch when the fediverse and the FEP-database gets bigger the need to check for these conflicts will rise quadratically. So you either:
- need to include type-definitions for fields with specific names
- use ap-object-types
or
- end up with incompatibilities and accept that as a fact which leads to bloaty (and potentially slow) unmarshalling logic on the implementation side.
Reply

---Replies---
silverpill@silverpill@mitra.social (2026-06-14 04:00:06)
@grindhold

e.g. we had this situation where content was defined as a Proposal as string, whereas in Note it was common to have a mapping from lang-code to a string in the according language as content.

I'm not sure if I understand. Mapping from lang-code to string it not content, it's contentMap: https://www.w3.org/TR/activitystreams-core/#naturalLanguageValues.

Proposal was designed with duck typing in mind. Proposal.content is same as Note.content, Proposal.attributedTo is same as Note.attributedTo. If everyone designs their extensions this way, duck typing works great.

The conflicts might occur but the solution to this is to use better names. So far I seen only one conflict: between Bookwyrm's quote and Mastodon's quote. In such cases you can use type for disambiguation - I am not saying that we should drop type completely. Ironically, though, Bookwyrm does use content negotiation. When it thinks that remote server is not Bookwyrm, it sends a Note instead of the original type, Quotation, thus making disambiguation impossible.

That's exactly how content negotiation will work in practice.

@sabrinkmann @Profpatsch