Add olm agentVersion to separate the library from the agent

This commit is contained in:
Owen
2026-10-22 14:59:33 -04:00
parent 8b509da19f
commit 290f1f2ff0
14 changed files with 107 additions and 46 deletions
+2 -6
View File
@@ -5,10 +5,9 @@ import { Newt } from "@server/db";
import { eq } from "drizzle-orm";
import logger from "@server/logger";
import { sendNewtSyncMessage } from "./sync";
import semver from "semver";
import { recordSitePing } from "./pingAccumulator";
import { supportsSync } from "@server/lib/clientVersionChecks";
const NEWT_SUPPORTS_SYNC_VERSION = ">=1.14.0";
const PONG = {
message: {
type: "pong",
@@ -50,10 +49,7 @@ export const handleNewtPingMessage: MessageHandler = async (context) => {
// cross-region latency to the database.
recordSitePing(newt.siteId);
if (
newt.version &&
!semver.satisfies(newt.version, NEWT_SUPPORTS_SYNC_VERSION)
) {
if (newt.version && !supportsSync(newt.version)) {
// Newt does not support the sync message so not checking - stop here -
return PONG;
}