mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 19:30:38 +08:00
Remove apiVersion in favor of deploymentId
Instead of relying on a `apiVersion` config variable that has to be changed and semver respected we use a deployment id that is new on each deployment to do cache busting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"nodes": {
|
||||
"fallbackPublicExplorer": "FALLBACK_PUBLIC_EXPLORER",
|
||||
"apiVersion": "API_VERSION",
|
||||
"requiredApiVersion": "REQUIRED_API_VERSION",
|
||||
"defaultHttpdPort": "DEFAULT_HTTPD_PORT",
|
||||
"defaultHttpdScheme": "DEFAULT_HTTPD_SCHEME"
|
||||
},
|
||||
@@ -9,6 +9,7 @@
|
||||
"commitsPerPage": "COMMITS_PER_PAGE"
|
||||
},
|
||||
"supportWebsite": "SUPPORT_WEBSITE",
|
||||
"deploymentId": "VERCEL_DEPLOYMENT_ID",
|
||||
"fallbackPreferredSeed": {
|
||||
"__name": "PREFERRED_SEEDS",
|
||||
"__format": "json"
|
||||
|
||||
+2
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"nodes": {
|
||||
"fallbackPublicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
|
||||
"requiredApiVersion": "^6.0.0",
|
||||
"requiredApiVersion": "~0.18.0",
|
||||
"defaultHttpdPort": 443,
|
||||
"defaultHttpdScheme": "https"
|
||||
},
|
||||
@@ -9,6 +9,7 @@
|
||||
"commitsPerPage": 30
|
||||
},
|
||||
"supportWebsite": "https://radicle.zulipchat.com",
|
||||
"deploymentId": null,
|
||||
"preferredSeeds": [
|
||||
{
|
||||
"hostname": "ash.radicle.garden",
|
||||
|
||||
@@ -113,10 +113,12 @@ export class Fetcher {
|
||||
params: FetchParams,
|
||||
schema: T,
|
||||
): Promise<TypeOf<T>> {
|
||||
const response = await this.fetch({
|
||||
...params,
|
||||
query: { ...params.query, v: config.nodes.requiredApiVersion },
|
||||
});
|
||||
if (config.deploymentId) {
|
||||
params.query ||= {};
|
||||
params.query["deployment_id"] = config.deploymentId;
|
||||
}
|
||||
|
||||
const response = await this.fetch(params);
|
||||
|
||||
if (!response.ok) {
|
||||
let responseBody = await response.text();
|
||||
@@ -138,7 +140,7 @@ export class Fetcher {
|
||||
throw new ResponseParseError(
|
||||
params.method,
|
||||
responseBody,
|
||||
info.apiVersion,
|
||||
info.version,
|
||||
result.error.errors,
|
||||
params.path,
|
||||
);
|
||||
|
||||
Vendored
+1
@@ -10,6 +10,7 @@ declare module "virtual:*" {
|
||||
source: {
|
||||
commitsPerPage: number;
|
||||
};
|
||||
deploymentId: string | null;
|
||||
reactions: string[];
|
||||
supportWebsite: string;
|
||||
preferredSeeds: BaseUrl[];
|
||||
|
||||
Reference in New Issue
Block a user