Skip to content

Commit 27a44e4

Browse files
committed
refactor(web): remove backend semver checks
1 parent 62f0d63 commit 27a44e4

File tree

4 files changed

+0
-99
lines changed

4 files changed

+0
-99
lines changed

frontend/apps/web/src/core/api.ts

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const connectionStatusProvider: IConnectionStatusProvider = {
1818

1919
export const api = new Api(connectionStatusProvider, baseURL);
2020

21-
const websocketURL = `${window.location.protocol === "https:" ? "wss" : "ws"}://${siteHost}/api/v1/ws`;
22-
2321
export const prepareAuthHeaders = (headers: Headers) => {
2422
const token = api.getAccessToken();
2523
if (token) {

frontend/libs/api/src/lib/api.ts

-24
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Client } from "./generated";
22
import { IConnectionStatusProvider, IHttpError } from "./types";
3-
import { isRequiredVersion } from "./version";
43

54
export class HttpError implements IHttpError {
65
constructor(
@@ -9,14 +8,9 @@ export class HttpError implements IHttpError {
98
) {}
109
}
1110

12-
// accepted version range of the backend api, [min, max)
13-
export const MIN_BACKEND_VERSION = "0.14.0";
14-
export const MAX_BACKEND_VERSION = "0.15.0";
15-
1611
export class Api {
1712
private baseApiUrl: string;
1813
private accessToken?: string;
19-
private backendVersion?: string;
2014

2115
public client: Client;
2216

@@ -48,24 +42,6 @@ export class Api {
4842
if (accessToken) {
4943
this.setAccessToken(accessToken);
5044
}
51-
await this.checkBackendVersion();
52-
};
53-
54-
private checkBackendVersion = async () => {
55-
if (this.backendVersion === undefined) {
56-
try {
57-
const version = await this.client.common.getVersion();
58-
this.backendVersion = version.version;
59-
} catch {
60-
// TODO: what to do here, should we propagate this error?
61-
return;
62-
}
63-
}
64-
if (!isRequiredVersion(this.backendVersion, MIN_BACKEND_VERSION, MAX_BACKEND_VERSION)) {
65-
throw new Error(
66-
`This app version is incompatible with the version your backend is running. Expected ${MIN_BACKEND_VERSION} (inclusive) to ${MAX_BACKEND_VERSION} (exclusive), but the backend is running ${this.backendVersion}`
67-
);
68-
}
6945
};
7046

7147
public waitUntilAuthenticated = async (): Promise<void> => {

frontend/libs/api/src/lib/version.test.ts

-24
This file was deleted.

frontend/libs/api/src/lib/version.ts

-49
This file was deleted.

0 commit comments

Comments
 (0)