Skip to content

fix: rename task timeout kind and also apply it to scheduler#1934

Open
IzaakGough wants to merge 3 commits into
masterfrom
@invertase/fix-timeout-kind-for-task-and-scheduler
Open

fix: rename task timeout kind and also apply it to scheduler#1934
IzaakGough wants to merge 3 commits into
masterfrom
@invertase/fix-timeout-kind-for-task-and-scheduler

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #1933

This PR renames the "task" timeout kind to "scheduledOrTask" and ensures that both task and scheduler functions use this. The documentation states that task and scheduler functions should have the same timeout settings, but scheduler functions were falling back to a generic "event" timeout kind.

Testing

  • Verified that the changes fix the example as described in the issue.
  • Automated tests pass

relnote: none

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the maximum timeout limit for scheduled functions (v2) from 540 seconds to 1800 seconds. To support this, the timeout category "task" has been renamed to "scheduledOrTask", and the constant "MAX_TASK_TIMEOUT_SECONDS" has been updated to "MAX_SCHEDULE_OR_TASK_TIMEOUT_SECONDS". Validation logic, tests, and error messages have been updated accordingly. I have no additional feedback to provide as there are no review comments.

@IzaakGough
IzaakGough marked this pull request as ready for review July 17, 2026 13:30

@cabljac cabljac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Two inline comments: the doc gap is worth fixing in this PR, the naming one is take it or leave it.

Comment thread src/v2/options.ts
/**
* Maximum timeout in seconds for event-handling functions (e.g. Firestore,
* Realtime Database, Pub/Sub, Storage, Eventarc, alerts, scheduler).
* Realtime Database, Pub/Sub, Storage, Eventarc, alerts).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch applying the kind to the scheduler too, and the boundary tests are exactly right.

One doc gap: the GlobalOptions.timeoutSeconds @remarks (around line 202) still only lists task queue functions at 1,800s, so the generated reference docs won't tell anyone that scheduled functions now share that cap. Please update that sentence to something like "Task queue and scheduled functions have a maximum timeout of 1,800s (30 minutes)." The same stale copy is on TaskQueueOptions.timeoutSeconds in tasks.ts:87, worth fixing both in this PR since it's the same sentence.

(That sentence is copy-pasted across most provider option types too, e.g. pubsub.ts, https.ts, storage.ts. Fine to leave those for a follow-up, but flagging so we don't lose track.)

Comment thread src/v2/options.ts Outdated
@wandamora
wandamora self-requested a review July 23, 2026 18:19

@wandamora wandamora left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as google review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v7.3.0 rejects valid 1800s timeout for v2 onSchedule functions

3 participants