@@ -69159,15 +69159,30 @@ async function getInstallationAuthentication(state, options, customRequest) {
6915969159 };
6916069160 return factory(factoryAuthOptions);
6916169161 }
69162- const optionsWithInstallationTokenFromState = Object.assign(
69163- { installationId },
69164- options
69162+ const request2 = customRequest || state.request;
69163+ return getInstallationAuthenticationConcurrently(
69164+ state,
69165+ { ...options, installationId },
69166+ request2
6916569167 );
69168+ }
69169+ var pendingPromises = /* @__PURE__ */ new Map();
69170+ function getInstallationAuthenticationConcurrently(state, options, request2) {
69171+ const cacheKey = optionsToCacheKey(options);
69172+ if (pendingPromises.has(cacheKey)) {
69173+ return pendingPromises.get(cacheKey);
69174+ }
69175+ const promise = getInstallationAuthenticationImpl(
69176+ state,
69177+ options,
69178+ request2
69179+ ).finally(() => pendingPromises.delete(cacheKey));
69180+ pendingPromises.set(cacheKey, promise);
69181+ return promise;
69182+ }
69183+ async function getInstallationAuthenticationImpl(state, options, request2) {
6916669184 if (!options.refresh) {
69167- const result = await get(
69168- state.cache,
69169- optionsWithInstallationTokenFromState
69170- );
69185+ const result = await get(state.cache, options);
6917169186 if (result) {
6917269187 const {
6917369188 token: token22,
@@ -69180,7 +69195,7 @@ async function getInstallationAuthentication(state, options, customRequest) {
6918069195 repositorySelection: repositorySelection2
6918169196 } = result;
6918269197 return toTokenAuthentication({
69183- installationId,
69198+ installationId: options.installationId ,
6918469199 token: token22,
6918569200 createdAt: createdAt2,
6918669201 expiresAt: expiresAt2,
@@ -69193,9 +69208,8 @@ async function getInstallationAuthentication(state, options, customRequest) {
6919369208 }
6919469209 }
6919569210 const appAuthentication = await getAppAuthentication(state);
69196- const request2 = customRequest || state.request;
6919769211 const payload = {
69198- installation_id: installationId,
69212+ installation_id: options. installationId,
6919969213 mediaType: {
6920069214 previews: ["machine-man"]
6920169215 },
@@ -69244,9 +69258,9 @@ async function getInstallationAuthentication(state, options, customRequest) {
6924469258 if (singleFileName) {
6924569259 Object.assign(payload, { singleFileName });
6924669260 }
69247- await set(state.cache, optionsWithInstallationTokenFromState , cacheOptions);
69261+ await set(state.cache, options , cacheOptions);
6924869262 const cacheData = {
69249- installationId,
69263+ installationId: options.installationId ,
6925069264 token: token2,
6925169265 createdAt,
6925269266 expiresAt,
@@ -69396,7 +69410,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
6939669410 return sendRequestWithRetries(state, request2, options, createdAt, retries);
6939769411 }
6939869412}
69399- var VERSION12 = "7.1.5 ";
69413+ var VERSION12 = "7.2.0 ";
6940069414function createAppAuth(options) {
6940169415 if (!options.appId) {
6940269416 throw new Error("[@octokit/auth-app] appId option is required");
0 commit comments