Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions apps/roam/src/components/settings/utils/accessors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,18 @@ export const setFeatureFlag = (
): void => {
const validatedValue = z.boolean().parse(value);

const legacyReader = FEATURE_FLAG_LEGACY_MAP[key];
const legacyValue = legacyReader ? legacyReader() : undefined;
const currentBlockProps = getFeatureFlags()[key];
const match = currentBlockProps === legacyValue;
console.groupCollapsed(
`[DG Dual-Read] Set Feature Flag > ${key} — ${match ? "Settings match" : "Settings don't match"}`,
);
console.log("Legacy:", legacyValue);
console.log("Block props:", currentBlockProps);
console.log("New value:", validatedValue);
console.groupEnd();
Comment thread
sid597 marked this conversation as resolved.
Outdated

setBlockPropBasedSettings({
keys: [TOP_LEVEL_BLOCK_PROP_KEYS.featureFlags, key],
value: validatedValue,
Expand Down Expand Up @@ -832,6 +844,18 @@ export const setGlobalSetting = (keys: string[], value: json): void => {
return;
}

const currentBlockProps = readPathValue(getGlobalSettings(), keys);
const legacyValue = getLegacyGlobalSetting(keys);
const match =
JSON.stringify(currentBlockProps) === JSON.stringify(legacyValue);
Comment thread
sid597 marked this conversation as resolved.
Outdated
console.groupCollapsed(
`[DG Dual-Read] Set Global > ${formatSettingPath(keys)} — ${match ? "Settings match" : "Settings don't match"}`,
);
console.log("Legacy:", legacyValue);
console.log("Block props:", currentBlockProps);
console.log("New value:", value);
console.groupEnd();

setBlockPropBasedSettings({
keys: [TOP_LEVEL_BLOCK_PROP_KEYS.global, ...keys],
value,
Expand Down Expand Up @@ -906,6 +930,18 @@ export const setPersonalSetting = (keys: string[], value: json): void => {
return;
}

const currentBlockProps = readPathValue(getPersonalSettings(), keys);
const legacyValue = getLegacyPersonalSetting(keys);
const match =
JSON.stringify(currentBlockProps) === JSON.stringify(legacyValue);
console.groupCollapsed(
`[DG Dual-Read] Set Personal > ${formatSettingPath(keys)} — ${match ? "Settings match" : "Settings don't match"}`,
);
console.log("Legacy:", legacyValue);
console.log("Block props:", currentBlockProps);
console.log("New value:", value);
console.groupEnd();

setBlockPropBasedSettings({
keys: [personalKey, ...keys],
value,
Expand Down Expand Up @@ -1013,6 +1049,21 @@ export const setDiscourseNodeSetting = (
return;
}

const currentSettings = getDiscourseNodeSettings(nodeType);
const currentBlockPropsValue = currentSettings
? readPathValue(currentSettings, keys)
: undefined;
const legacyValue = getLegacyDiscourseNodeSetting(nodeType, keys);
const match =
JSON.stringify(currentBlockPropsValue) === JSON.stringify(legacyValue);
console.groupCollapsed(
`[DG Dual-Read] Set Discourse Node (${nodeType}) > ${formatSettingPath(keys)} — ${match ? "Settings match" : "Settings don't match"}`,
);
console.log("Legacy:", legacyValue);
console.log("Block props:", currentBlockPropsValue);
console.log("New value:", value);
console.groupEnd();

setBlockPropAtPath(pageUid, keys, value);
};

Expand Down
2 changes: 1 addition & 1 deletion apps/roam/src/utils/storedRelations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { USE_STORED_RELATIONS } from "~/data/userSettings";
import { getSetting, setSetting } from "./extensionSettings";
import { DISCOURSE_CONFIG_PAGE_TITLE } from "./renderNodeConfigPage";
import { DISCOURSE_CONFIG_PAGE_TITLE } from "~/data/constants";

const INSTALL_CUTOFF = Date.parse("2026-03-01T00:00:00.000Z");

Expand Down