Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud tasks headers are not exposed #1340

Open
AmichayMiara opened this issue Jan 19, 2023 · 4 comments
Open

Cloud tasks headers are not exposed #1340

AmichayMiara opened this issue Jan 19, 2023 · 4 comments

Comments

@AmichayMiara
Copy link

[REQUIRED] Version info

node: v18.13.0

firebase-functions: 4.1.1

firebase-tools: 11.20.0

firebase-admin: 11.4.1

[REQUIRED] Test case

https://firebase.google.com/docs/functions/task-functions#task_queue_configuration

onDispatch function is getting the task data but not the task headers.

export function onDispatchHandler<Req = any>(
handler: v1TaskHandler | v2TaskHandler<Req>
): (req: https.Request, res: express.Response) => Promise<void> {

We noticed that the headers are exposed when triggered by HTTP target task handler (https://cloud.google.com/tasks/docs/creating-http-target-tasks#handler), and we expect to also get them via onDispatch handler context object.

It seems that the headers can be useful for various purposes.
As an example, We particularly interested in the X-CloudTasks-TaskExecutionCount header, as it would allow us to better understand how tasks are being executed.

image

[REQUIRED] Steps to reproduce

No steps to reproduce. Right now task headers are not accessible using onDispatch.

[REQUIRED] Expected behavior

Task headers to be exposed.

[REQUIRED] Actual behavior

Task headers are not exposed.

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@taeold
Copy link
Contributor

taeold commented Jan 19, 2023

Thanks for the feature request @AmichayMiara!

Internal note: similar to #1178

@sdegroot
Copy link

Hi all, is there any known planning on when this feature will be released?

@gustavopch
Copy link

This was actually released in https://github.com/firebase/firebase-functions/releases/tag/v4.5.0 (PR: #1423) and this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants