Force jit above site limit

This commit is contained in:
Owen
2026-03-06 14:09:57 -08:00
parent 2a5c9465e9
commit 9405b0b70a

View File

@@ -17,6 +17,8 @@ import { getUserDeviceName } from "@server/db/names";
import { buildSiteConfigurationForOlmClient } from "./buildConfiguration"; import { buildSiteConfigurationForOlmClient } from "./buildConfiguration";
import { OlmErrorCodes, sendOlmError } from "./error"; import { OlmErrorCodes, sendOlmError } from "./error";
import { handleFingerprintInsertion } from "./fingerprintingUtils"; import { handleFingerprintInsertion } from "./fingerprintingUtils";
import { Alias } from "@server/lib/ip";
import { build } from "@server/build";
export const handleOlmRegisterMessage: MessageHandler = async (context) => { export const handleOlmRegisterMessage: MessageHandler = async (context) => {
logger.info("Handling register olm message!"); logger.info("Handling register olm message!");
@@ -265,20 +267,26 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
return; return;
} }
// // NOTE: its important that the client here is the old client and the public key is the new key let siteConfigurations: {
// const siteConfigurations = await buildSiteConfigurationForOlmClient( siteId: number;
// client, name: string;
// publicKey, endpoint: string;
// relay publicKey: string | null;
// ); serverIP: string | null;
serverPort: number | null;
remoteSubnets: string[];
aliases: Alias[];
}[] = [];
const siteConfigurations: any = []; // If we have too many sites we need to drop into fully JIT mode by not sending any of the sites
if (sitesCount <= 250 && build == "saas") { // THIS IS THE MAX ON THE BUSINESS TIER
// REMOVED THIS SO IT CREATES THE INTERFACE AND JUST WAITS FOR THE SITES // NOTE: its important that the client here is the old client and the public key is the new key
// if (siteConfigurations.length === 0) { siteConfigurations = await buildSiteConfigurationForOlmClient(
// logger.warn("No valid site configurations found"); client,
// return; publicKey,
// } relay
);
}
// Return connect message with all site configurations // Return connect message with all site configurations
return { return {