You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
context.scheduler.runJob() returns a valid job UUID, but the job never executes. context.scheduler.listJobs() returns an empty array immediately after runJob() returns. This affects both recurring cron jobs and one-shot runAt jobs. Menu item handlers and AppInstall / AppUpgrade triggers fire correctly on the same app, so the issue is isolated to the scheduler itself.
The behavior reproduces on both an uploaded (private) app and a published (unlisted) app, ruling out publish status as a factor.
Note that jobId is a valid UUID and is persisted to Redis successfully.
Immediately call context.scheduler.listJobs() from a moderator menu item.
Observed behavior
runJob() returns a valid UUID (e.g. 9225215c-f9df-4304-8069-4bf8c4f1da2c).
listJobs() returns [].
The registered job never executes. No onRun invocation. No log output. No side effects (no Reddit post submitted from inside the handler, even when the handler is reduced to a single submitPost call as a smoke test).
This is true for both cron recurring jobs and runAt one-shot jobs.
This is true on the uploaded version (v0.0.13) and on the published unlisted version (v0.0.14).
Expected behavior
runJob() returns a UUID.
listJobs() returns a non-empty array containing that UUID.
The job's onRun handler executes at the scheduled time.
Diagnostic evidence
A moderator menu item posts a self-post showing the stored job ID and the result of listJobs():
Scheduler Status — 0 active job(s)
Stored cronJobId: 9225215c-f9df-4304-8069-4bf8c4f1da2c
Active jobs: No active jobs found.
The stored ID changes across upgrades (v0.0.13 stored 085a820b-da46-4235-bf05-febac368531d; v0.0.14 stored 9225215c-f9df-4304-8069-4bf8c4f1da2c), confirming the AppUpgrade trigger is firing and runJob() is being called and returning successfully each time. The job simply never appears in listJobs() and never executes.
What I've already tried (ruled out as causes)
Cron expression syntax. Failure reproduces with runAt: new Date(...) one-shot jobs, not just cron.
runAt vs when parameter. Confirmed against the installed @devvit/public-api types that runAt is the correct parameter; when produces a TS2353 type error. Both forms fail at runtime regardless.
Self-rescheduling one-shot pattern. Replaced cron with a runAt job that re-schedules itself at the end of onRun. Same failure: the first job never fires, so the chain never starts.
Trigger registration.AppInstall and AppUpgrade triggers are confirmed firing (Redis writes happen, console logs appear in devvit logs).
Menu items. Menu item onPress handlers execute correctly, including submitPost calls. The app is fully functional except for scheduled execution.
App publish status. Bug reproduces on both uploaded and published-unlisted versions.
Question
Is there a known issue with scheduler execution on apps installed in private subreddits, or some other configuration gate I'm missing? Given that runJob() returns successfully but listJobs() shows nothing, it looks like the scheduler is silently dropping registered jobs. Any guidance on how to debug further from the application side would be appreciated.
Summary
context.scheduler.runJob()returns a valid job UUID, but the job never executes.context.scheduler.listJobs()returns an empty array immediately afterrunJob()returns. This affects both recurringcronjobs and one-shotrunAtjobs. Menu item handlers andAppInstall/AppUpgradetriggers fire correctly on the same app, so the issue is isolated to the scheduler itself.The behavior reproduces on both an uploaded (private) app and a published (unlisted) app, ruling out publish status as a factor.
Environment
rapids-match-bot0.12.13@devvit/public-api: latest at time of build0.0.3through0.0.14(all exhibit the bug)uploaded(v0.0.13) andpublished unlisted(v0.0.14)r/rapids_match_bot_dev(private dev sub, mod-installed)Steps to reproduce
AppInstall/AppUpgradetrigger, first iteratelistJobs()andcancelJob()each (per Reinstalling an application creates a ghost of its schedules #239 mitigation), then call:jobIdis a valid UUID and is persisted to Redis successfully.context.scheduler.listJobs()from a moderator menu item.Observed behavior
runJob()returns a valid UUID (e.g.9225215c-f9df-4304-8069-4bf8c4f1da2c).listJobs()returns[].onRuninvocation. No log output. No side effects (no Reddit post submitted from inside the handler, even when the handler is reduced to a singlesubmitPostcall as a smoke test).cronrecurring jobs andrunAtone-shot jobs.Expected behavior
runJob()returns a UUID.listJobs()returns a non-empty array containing that UUID.onRunhandler executes at the scheduled time.Diagnostic evidence
A moderator menu item posts a self-post showing the stored job ID and the result of
listJobs():Scheduler Status — 0 active job(s)
Stored cronJobId: 9225215c-f9df-4304-8069-4bf8c4f1da2c
Active jobs: No active jobs found.
The stored ID changes across upgrades (v0.0.13 stored
085a820b-da46-4235-bf05-febac368531d; v0.0.14 stored9225215c-f9df-4304-8069-4bf8c4f1da2c), confirming the AppUpgrade trigger is firing andrunJob()is being called and returning successfully each time. The job simply never appears inlistJobs()and never executes.What I've already tried (ruled out as causes)
runAt: new Date(...)one-shot jobs, not just cron.runAtvswhenparameter. Confirmed against the installed@devvit/public-apitypes thatrunAtis the correct parameter;whenproduces a TS2353 type error. Both forms fail at runtime regardless.listJobs()andcancelJob()runs at the top of everyAppInstall/AppUpgradetrigger before any newrunJob()calls. No effect.runAtjob that re-schedules itself at the end ofonRun. Same failure: the first job never fires, so the chain never starts.AppInstallandAppUpgradetriggers are confirmed firing (Redis writes happen, console logs appear indevvit logs).onPresshandlers execute correctly, includingsubmitPostcalls. The app is fully functional except for scheduled execution.Question
Is there a known issue with scheduler execution on apps installed in private subreddits, or some other configuration gate I'm missing? Given that
runJob()returns successfully butlistJobs()shows nothing, it looks like the scheduler is silently dropping registered jobs. Any guidance on how to debug further from the application side would be appreciated.Related