Compare commits

...

3 commits

Author SHA1 Message Date
Johannes Marbach d281b10b89
Merge fdd2a9abe8 into 6a001cccb0 2026-03-10 18:31:48 +00:00
Hugh Nimmo-Smith 6a001cccb0
Spec for MSC4335: M_USER_LIMIT_EXCEEDED error code (#2315)
Signed-off-by: Hugh Nimmo-Smith hughns@element.io
2026-03-10 17:53:14 +00:00
Johannes Marbach fdd2a9abe8 Add page search widget
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-06 15:25:50 +01:00
8 changed files with 70 additions and 0 deletions

View file

@ -236,6 +236,10 @@ jobs:
run: |
tar -C "spec${baseURL}" --strip-components=1 -xzf openapi.tar.gz
- name: "🔍 pagefind indexing"
run: |
npx -y pagefind --site "spec${baseURL}"
- name: "📦 Tarball creation"
run: |
cd spec

View file

@ -661,3 +661,9 @@ dd {
margin: 0;
}
}
/* Style for page search */
#search {
display: none;
padding-bottom: 1rem;
}

View file

@ -0,0 +1 @@
Add `M_USER_LIMIT_EXCEEDED` common error code, as per [MSC4335](https://github.com/matrix-org/matrix-spec-proposals/pull/4335).

View file

@ -0,0 +1 @@
Add page search widget.

View file

@ -147,6 +147,37 @@ state (e.g.: sending messages, account data, etc) and not routes which
only read state (e.g.: [`/sync`](#get_matrixclientv3sync),
[`/user/{userId}/account_data/{type}`](#get_matrixclientv3useruseridaccount_datatype), etc).
`M_USER_LIMIT_EXCEEDED`
: {{% added-in v="1.18" %}} The request cannot be completed because the user has
exceeded (or the request would cause them to exceed) a limit associated with
their account. For example, a user may have reached their allocated storage
quota, reached a maximum number of allowed rooms, devices, or other
account-scoped resources, or exceeded usage limits for specific features.
: The error response MUST have an `info_uri` field (string), which is a URI
that the client can present to the user to provide more context on the
encountered limit and, if applicable, guidance on how to increase the limit.
The homeserver MAY return different values for `info_uri` depending on the type
of limit reached.
: The error response MAY include a `can_upgrade` field (boolean, default `false`).
If `true`, it indicates that the specific limit encountered can be increased,
for example by upgrading the user's account tier. If absent or `false`, the
limit is a hard limit that cannot be increased.
: The HTTP status code will depend on depend on the particular endpoint.
: Example response:
```json
{
"errcode": "M_USER_LIMIT_EXCEEDED",
"error": "You have exceeded your storage quota of 10GB",
"info_uri": "https://example.com/homeserver/about?limit_type=quota",
"can_upgrade": true
}
```
`M_UNKNOWN`
: An unknown error has occurred.

View file

@ -16,3 +16,7 @@
{{ $inter := resources.Get "css/fonts/Inter.css" -}}
<link rel="preload" href="{{ $inter.RelPermalink }}" as="style">
<link rel="stylesheet" href="{{ $inter.RelPermalink }}">
{{/* Load Pagefind stuff to power the page search. */}}
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
<script src="/pagefind/pagefind-ui.js"></script>

View file

@ -61,6 +61,28 @@
</a>
</li>
{{ end -}}
<li class="nav-item" id="search-button">
<a class="nav-link" href="#" role="button">Search</a>
</li>
<script>
document.querySelector("#search-button").addEventListener("click", (event) => {
const search = document.querySelector("#search");
if (search.style.display === "block") {
// Hide the search widget.
search.style.display = "none";
} else {
// Initialise the search widget if needed.
if (!search.innerHTML.length) {
new PagefindUI({ element: "#search", showSubResults: true });
}
// Unhide and focus the search widget.
search.style.display = "block";
search.querySelector("input").focus();
}
});
</script>
{{ if .Site.Params.versions -}}
<li class="nav-item dropdown d-none d-lg-block td-navbar__version-menu">
{{ partial "navbar-version-selector.html" . -}}

View file

@ -49,6 +49,7 @@
</aside>
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main">
{{ partial "version-banner.html" . }}
<div id="search"></div>
{{ if not (.Param "ui.breadcrumb_disable") -}}
{{ partial "breadcrumb.html" . -}}
{{ end -}}