You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
Bump minimum spec version to v1.5 (#3970)
* Update minimum spec version * Update README.md * fix autodiscovery tests
This commit is contained in:
committed by
GitHub
parent
ffc9fb34d0
commit
070a89d89d
@@ -11,7 +11,7 @@
|
|||||||
This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a
|
This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a
|
||||||
browser or in Node.js.
|
browser or in Node.js.
|
||||||
|
|
||||||
#### Minimum Matrix server version: v1.1
|
#### Minimum Matrix server version: v1.5
|
||||||
|
|
||||||
The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only
|
The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only
|
||||||
guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports
|
guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ describe("AutoDiscovery", function () {
|
|||||||
function () {
|
function () {
|
||||||
const httpBackend = getHttpBackend();
|
const httpBackend = getHttpBackend();
|
||||||
httpBackend.when("GET", "/_matrix/client/versions").respond(200, {
|
httpBackend.when("GET", "/_matrix/client/versions").respond(200, {
|
||||||
not_matrix_versions: ["v1.1"],
|
not_matrix_versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
@@ -388,7 +388,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
@@ -428,7 +428,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
@@ -469,7 +469,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
@@ -515,7 +515,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
@@ -560,7 +560,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
@@ -606,7 +606,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/_matrix/identity/v2").respond(404, {});
|
httpBackend.when("GET", "/_matrix/identity/v2").respond(404, {});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
@@ -653,7 +653,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend.when("GET", "/_matrix/identity/v2").respond(500, {});
|
httpBackend.when("GET", "/_matrix/identity/v2").respond(500, {});
|
||||||
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
httpBackend.when("GET", "/.well-known/matrix/client").respond(200, {
|
||||||
@@ -697,7 +697,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend
|
httpBackend
|
||||||
.when("GET", "/_matrix/identity/v2")
|
.when("GET", "/_matrix/identity/v2")
|
||||||
@@ -747,7 +747,7 @@ describe("AutoDiscovery", function () {
|
|||||||
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
expect(req.path).toEqual("https://chat.example.org/_matrix/client/versions");
|
||||||
})
|
})
|
||||||
.respond(200, {
|
.respond(200, {
|
||||||
versions: ["v1.1"],
|
versions: ["v1.5"],
|
||||||
});
|
});
|
||||||
httpBackend
|
httpBackend
|
||||||
.when("GET", "/_matrix/identity/v2")
|
.when("GET", "/_matrix/identity/v2")
|
||||||
@@ -910,7 +910,7 @@ describe("AutoDiscovery", function () {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fetchMock.resetBehavior();
|
fetchMock.resetBehavior();
|
||||||
fetchMock.get(`${homeserverUrl}_matrix/client/versions`, { versions: ["v1.1"] });
|
fetchMock.get(`${homeserverUrl}_matrix/client/versions`, { versions: ["v1.5"] });
|
||||||
|
|
||||||
fetchMock.get("https://example.org/.well-known/matrix/client", {
|
fetchMock.get("https://example.org/.well-known/matrix/client", {
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
|
|||||||
@@ -16,5 +16,8 @@ limitations under the License.
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimum Matrix specification version the js-sdk supports.
|
* The minimum Matrix specification version the js-sdk supports.
|
||||||
|
*
|
||||||
|
* (This means that we require any servers we connect to to declare support for this spec version, so it is important
|
||||||
|
* for it not to be too old, as well as not too new.)
|
||||||
*/
|
*/
|
||||||
export const MINIMUM_MATRIX_VERSION = "v1.1";
|
export const MINIMUM_MATRIX_VERSION = "v1.5";
|
||||||
|
|||||||
Reference in New Issue
Block a user