Skip to content

API warts #457

@kegsay

Description

@kegsay

Filing this issue to remember when I fight against the API shapes in GMSL.

  • lenientByteLimitRoomVersions is awful because you can't just copy/paste a room version impl, but need to also update this map. Remove it. It's used in the global function CheckFields(input PDU), which should really be a room version specific function. We should also move ALL validation there instead of the hodge podge we have currently. GMSL calls CheckFields when:
    • it makes an event via the builder
    • in newEventFromUntrustedJSON.
  • The fact the event structs are internal is frustrating from an expansion point of view. That being said, it's useful to be able to tweak the impl knowing people are just interacting with PDU interfaces. Can we get the best of both worlds somehow?
  • s/eventversion.go/room_versions.go/g given events don't have versions..
  • EventBuilder is pretty horrible, as the set of keys is fixed so doesn't allow adjustments with different room versions (and the IRoomVersion interface returns concrete EventBuilders.
  • Make/Send invite/join/leave should all be room version specific, given they involve creating events which may have different forms.
  • StateNeeded and auth rules are technically room version specific.
  • Error handling on state res code is rubbish Horrible fix for https://github.com/element-hq/dendrite/issues/3629 #460

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions