Compare commits

..
Author SHA1 Message Date
Julius Marmingeandcodex 8aa8f981c5 migrate Effect.fn in apps/server/src/telemetry/Identify.ts
Co-authored-by: codex <[email protected]>
2026-04-01 00:27:49 -07:00
2 changed files with 21 additions and 21 deletions

No files matched your search

+19 -19
View File
@@ -328,23 +328,24 @@ export const ResolvedKeybindingFromConfig = KeybindingRule.pipe(
Effect.map((resolved) => resolved),
),
encode: Effect.fn("ResolvedKeybindingFromConfig.encode")(function* (resolved) {
const key = encodeShortcut(resolved.shortcut);
if (!key) {
return yield* Effect.fail(
new SchemaIssue.InvalidValue(Option.some(resolved), {
title: "Resolved shortcut cannot be encoded to key string",
}),
);
}
encode: (resolved) =>
Effect.gen(function* () {
const key = encodeShortcut(resolved.shortcut);
if (!key) {
return yield* Effect.fail(
new SchemaIssue.InvalidValue(Option.some(resolved), {
title: "Resolved shortcut cannot be encoded to key string",
}),
);
}
const when = resolved.whenAst ? encodeWhenAst(resolved.whenAst) : undefined;
return {
key,
command: resolved.command,
when,
};
}),
const when = resolved.whenAst ? encodeWhenAst(resolved.whenAst) : undefined;
return {
key,
command: resolved.command,
when,
};
}),
}),
),
);
@@ -580,9 +581,8 @@ const makeKeybindings = Effect.gen(function* () {
),
);
return yield* Effect.forEach(
rawConfig,
Effect.fn("loadWritableCustomKeybindingsConfig.decodeEntry")(function* (entry) {
return yield* Effect.forEach(rawConfig, (entry) =>
Effect.gen(function* () {
const decodedRule = Schema.decodeUnknownExit(KeybindingRule)(entry);
if (decodedRule._tag === "Failure") {
yield* Effect.logWarning("ignoring invalid keybinding entry", {
+2 -2
View File
@@ -60,11 +60,11 @@ const upsertAnonymousId = Effect.gen(function* () {
const anonymousId = yield* fileSystem.readFileString(anonymousIdPath).pipe(
Effect.catch(() =>
Effect.gen(function* () {
Effect.fn("upsertAnonymousId.createAnonymousId")(function* () {
const randomId = yield* Random.nextUUIDv4;
yield* fileSystem.writeFileString(anonymousIdPath, randomId);
return randomId;
}),
})(),
),
);