matrix-org / matrix-org/matrix-spec

Separate filter IDs from filter structs in /sync

Open
#230 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Client-Server enhancement
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

Currenlty the `/sync` endpoint accepts both a filter id and a json filter struct on the same `filter` field.

> The ID of a filter created using the filter API or a filter JSON object encoded as a string. The server will detect whether it is an ID or a JSON object by whether the first character is a "{" open brace. Passing the JSON inline is best suited to one off requests. Creating a filter using the filter API is recommended for clients that reuse the same filter multiple times, for example in long poll requests.

It seems like a hacky solution to the problem of one off requests because they are two completely different types that require different parsing. Also the implementation on a static type language will be a little awkward. Instead of overloading the `filter` field there could be two separate fields, one for filter IDs and one for filter structs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the `/sync` endpoint description and the filter API wording in this issue. Define separate request fields for filter IDs and inline filter objects, then update the specification so their parsing and one-off versus reusable usage are unambiguous.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.