matrix-org / matrix-org/gomatrixserverlib
API warts
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 67
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
Filing this issue to remember when I fight against the API shapes in GMSL.
lenientByteLimitRoomVersionsis 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 functionCheckFields(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 callsCheckFieldswhen:- 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
PDUinterfaces. Can we get the best of both worlds somehow? s/eventversion.go/room_versions.go/ggiven events don't have versions..EventBuilderis pretty horrible, as the set of keys is fixed so doesn't allow adjustments with different room versions (and the IRoomVersion interface returns concreteEventBuilders.- 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 https://github.com/matrix-org/gomatrixserverlib/pull/460
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the global CheckFields(input PDU) entry point, its calls from the builder and newEventFromUntrustedJSON, and the room-version concerns listed for eventversion.go and EventBuilder. Review the linked pull request for state response error handling; the issue needs a scoped design and explicit completion criteria before implementation can begin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100