firebase / firebase/firebase-tools

[FR] Support for scheduled functions in emulator

Open
#2,034 55 comments 141 reactions 0 assignees View on GitHub
emulator-suite emulators: functions emulators: pubsub internal-bug-filed type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 7.15.0 & 7.15.1

**Platform:** macOS 18.7.0 Darwin Kernel Version 18.7.0:

### [REQUIRED] Test case

```typescript
export const pubsubScheduled = functions.pubsub
.schedule('every 1 minutes')
.onRun(context => {
console.log('Resource', JSON.stringify(context.resource));
return true;
});
```

### [REQUIRED] Steps to reproduce

`firebase emulators firebase emulators:start`
`✔ functions[pubsubScheduled]: pubsub function initialized.`

### [REQUIRED] Expected behavior

Logging every 1 minute in the console

### [REQUIRED] Actual behavior

No output

Links:
https://github.com/firebase/firebase-tools/commit/b6fa88aa166bddc8969cbed7bd3b35392e307dd5

https://github.com/firebase/firebase-tools/commit/4dc64dac1d54f9e863fa2a99769bca447320940f

https://github.com/firebase/firebase-tools/pull/1543#issuecomment-600763141

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the referenced commits and the discussion on pull request #1543, then reproduce the TypeScript scheduled function with the Firebase CLI emulator command from the issue. Trace the emulator behavior for the scheduled function and verify completion by observing its console output every minute.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, typescript
Domain
cli, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.