matrix-org / matrix-org/matrix-js-sdk

The JS SDK shouldn't include functions specific to Synapse Admin endpoints

Open
#2,068 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.2k
Forks
704
Avg merge
1d 20h
Merged PRs (30d)
40

Description

The current endpoints seem like they should not appear as part of the JS SDK:
```
src/client.ts
5986: "/_synapse/admin/v1/users/$userId/admin",
6003: "/_synapse/admin/v1/whois/$userId",
6017: "/_synapse/admin/v1/deactivate/$userId",
```

The relevant functions are
`isSynapseAdministrator()`, `whoisSynapseUser(userId: string)`, `deactivateSynapseUser(userId: string)`

They're problematic for two reasons:
* they're not portable to other homeserver implementations
* they're not portable across all Synapse deployments — the Synapse documentation advises against exposing these endpoints to the public. See https://github.com/matrix-org/synapse/pull/11572 for an issue where this has caused confusion for a homeserver admin who didn't expect to see Element making requests to URLs that give 404s by default.

N.B. They seem to be used by the React SDK in the user panel, seemingly for deciding whether to show the option to deactivate a user.

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 in src/client.ts at the listed endpoint functions: isSynapseAdministrator(), whoisSynapseUser(), and deactivateSynapseUser(). Then inspect the React SDK user panel usage to understand the dependency and determine what must change when these Synapse-specific endpoints are removed. Done means the JS SDK no longer exposes these functions or requests these endpoints, while the affected user-panel behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.