Skip to content

Commit 8367b42

Browse files
authored
fixes function name resolution to cloud tasks emulator queue (#2726)
1 parent 365bdb9 commit 8367b42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/functions/functions-api-client-internal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class FunctionsApiClient {
9292
}
9393

9494
try {
95-
const serviceUrl = tasksEmulatorUrl(resources, functionName)?.concat('/', id)
95+
const serviceUrl = tasksEmulatorUrl(resources)?.concat('/', id)
9696
?? await this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT.concat('/', id));
9797
const request: HttpRequestConfig = {
9898
method: 'DELETE',
@@ -147,7 +147,7 @@ export class FunctionsApiClient {
147147
const task = this.validateTaskOptions(data, resources, opts);
148148
try {
149149
const serviceUrl =
150-
tasksEmulatorUrl(resources, functionName) ??
150+
tasksEmulatorUrl(resources) ??
151151
await this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT);
152152

153153
const taskPayload = await this.updateTaskPayload(task, resources, extensionId);
@@ -436,9 +436,9 @@ export class FirebaseFunctionsError extends PrefixedFirebaseError {
436436
}
437437
}
438438

439-
function tasksEmulatorUrl(resources: utils.ParsedResource, functionName: string): string | undefined {
439+
function tasksEmulatorUrl(resources: utils.ParsedResource): string | undefined {
440440
if (process.env.CLOUD_TASKS_EMULATOR_HOST) {
441-
return `http://${process.env.CLOUD_TASKS_EMULATOR_HOST}/projects/${resources.projectId}/locations/${resources.locationId}/queues/${functionName}/tasks`;
441+
return `http://${process.env.CLOUD_TASKS_EMULATOR_HOST}/projects/${resources.projectId}/locations/${resources.locationId}/queues/${resources.resourceId}/tasks`;
442442
}
443443
return undefined;
444444
}

0 commit comments

Comments
 (0)