firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

Cloud tasks headers are not exposed

Open AmichayMiara opened this issue 2 years ago • 4 comments

[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.

https://github.com/firebase/firebase-functions/blob/0b066d6d616475a37ae411c0346e2350dd8af435/src/common/providers/tasks.ts#L112-L114

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.

AmichayMiara avatar Jan 19 '23 15:01 AmichayMiara

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.

google-oss-bot avatar Jan 19 '23 15:01 google-oss-bot

Thanks for the feature request @AmichayMiara!

Internal note: similar to https://github.com/firebase/firebase-functions/issues/1178

taeold avatar Jan 19 '23 20:01 taeold

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

sdegroot avatar Apr 13 '23 18:04 sdegroot

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

gustavopch avatar Apr 06 '24 16:04 gustavopch