fix(stylesheet): skip parity on explicit activation (#3316)

This commit is contained in:
Amruth Pillai
2026-08-13 15:53:28 +02:00
committed by GitHub
parent 5a75eda893
commit 3635b3d578
9 changed files with 4 additions and 204 deletions
@@ -6,7 +6,6 @@ import type { StylesheetSnapshot } from "./stylesheet-service";
import { ORPCError } from "@orpc/client";
import { compileStylesheet } from "@reactive-resume/resume/stylesheet";
import { EMPTY_SEMANTIC_CSS_SOURCE } from "@reactive-resume/schema/resume/stylesheet";
import { templateSchema } from "@reactive-resume/schema/templates";
import { recordSemanticCssEvent } from "./stylesheet-observability";
type PrepareImportedResumeDataInput = {
@@ -191,47 +190,3 @@ export async function convertLegacyStylesheet(snapshot: StylesheetSnapshot): Pro
throw error;
}
}
export async function checkLegacyStylesheetParity(input: {
data: ResumeData;
stylesheet: StylesheetSource;
resumeId: string;
revision: number;
}): Promise<{ mismatches: readonly string[] }> {
const startedAt = performance.now();
try {
const { compareLegacySemanticPresentation } = await import("@reactive-resume/pdf/semantic");
const result = await compareLegacySemanticPresentation({
data: input.data,
convertedSource: input.stylesheet,
templates: templateSchema.options,
});
recordSemanticCssEvent({
name: "semantic_css.parity_check",
resumeId: input.resumeId,
durationMs: performance.now() - startedAt,
languageVersion: input.stylesheet.languageVersion,
sourceBytes: byteCount(input.stylesheet),
template: input.data.metadata.template,
diagnosticCodes: [],
pageCount: null,
revision: input.revision,
success: result.mismatches.length === 0,
});
return result;
} catch (error) {
recordSemanticCssEvent({
name: "semantic_css.parity_check",
resumeId: input.resumeId,
durationMs: performance.now() - startedAt,
languageVersion: input.stylesheet.languageVersion,
sourceBytes: byteCount(input.stylesheet),
template: input.data.metadata.template,
diagnosticCodes: [],
pageCount: null,
revision: input.revision,
success: false,
});
throw error;
}
}