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
5 changes: 3 additions & 2 deletions algolia/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ export async function initAlgoliaFromBlocks(
const searchApiKey = typeof block.searchApiKey === "string" ? block.searchApiKey : "";

const adminApiKeyEnvName: string =
block.adminApiKey && typeof block.adminApiKey === "object" &&
typeof (block.adminApiKey as { name?: unknown }).name === "string"
block.adminApiKey &&
typeof block.adminApiKey === "object" &&
typeof (block.adminApiKey as { name?: unknown }).name === "string"
? (block.adminApiKey as { name: string }).name
: "";
const adminApiKey = (await resolveSecret(block.adminApiKey, adminApiKeyEnvName)) ?? "";
Expand Down
4 changes: 1 addition & 3 deletions vtex/__tests__/client-set-cookie-forward.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ describe("vtexFetchWithCookies — inbound Set-Cookie capture", () => {
setVtexFetch((() =>
Promise.resolve(
mockResponse({
setCookies: [
"checkout.vtex.com=__ofid=abc; Domain=.vtexcommercestable.com.br; Path=/",
],
setCookies: ["checkout.vtex.com=__ofid=abc; Domain=.vtexcommercestable.com.br; Path=/"],
}),
)) as typeof fetch);
// No withRequest wrapper → RequestContext.current is null.
Expand Down
6 changes: 1 addition & 5 deletions vtex/utils/fetchCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ function isRetryable(response: Response): boolean {
* without this, a never-settling Promise leaks the Map slot forever and
* every subsequent request for the same key joins the zombie Promise.
*/
function withTimeout<T>(
work: Promise<T>,
ms: number,
label: string,
): Promise<T> {
function withTimeout<T>(work: Promise<T>, ms: number, label: string): Promise<T> {
let timer: ReturnType<typeof setTimeout> | undefined;
const timeout = new Promise<never>((_, reject) => {
timer = setTimeout(() => {
Expand Down
Loading