Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 5 additions & 4 deletions packages/annotation/src/useSubmitOnCmdEnter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ function buildKeyEvent(init: {
ctrlKey?: boolean;
preventDefault?: () => void;
}): KeyboardEvent<HTMLTextAreaElement> {
const { key, metaKey = false, ctrlKey = false, preventDefault = () => {} } = init;
return {
key: init.key,
metaKey: init.metaKey ?? false,
ctrlKey: init.ctrlKey ?? false,
preventDefault: init.preventDefault ?? (() => {}),
key,
metaKey,
ctrlKey,
preventDefault,
} as unknown as KeyboardEvent<HTMLTextAreaElement>;
}
4 changes: 2 additions & 2 deletions packages/cli/src/testHelpers/annotationFakes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function createAnnotationDependencies(
result?: Promise<AnnotationSubmission>;
} = {},
): TrackedAnnotationDependencies {
const { submission = annotationSubmission.build(), result = Promise.resolve(submission) } = options;
const payloads: AnnotationPayload[] = [];
const submission = options.submission ?? annotationSubmission.build();
const sigintRegistration = createDeferred<void>();
let closeCount = 0;
let observedPort: number | undefined;
Expand Down Expand Up @@ -71,7 +71,7 @@ export function createAnnotationDependencies(
return {
port: 4312,
url: 'http://localhost:4312',
result: options.result ?? Promise.resolve(submission),
result,
close: () => {
closeCount += 1;
return Promise.resolve();
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/updater/UpdaterImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,13 @@ export class UpdaterImpl {
constructor(private readonly deps: UpdaterImplDeps) {}

async checkForUpdate(options: CheckForUpdateOptions = {}): Promise<UpdateNotice | null> {
const { buildInfo, env, clock, logger } = this.deps;
const { buildInfo, env, clock, logger, ttl = Temporal.Duration.from({ hours: DEFAULT_TTL_HOURS }) } = this.deps;
const { forceRefresh = false } = options;

if (buildInfo.version === DEV_BUILD_VERSION) return null;
if (env.CONTEXTBRIDGE_UPDATE_CHECK_DISABLED) return null;

const now = clock();
const ttl = this.deps.ttl ?? Temporal.Duration.from({ hours: DEFAULT_TTL_HOURS });

if (!forceRefresh) {
const cached = this.readCache(buildInfo.channel, now, ttl);
Expand Down
Loading