Reinstalling an application creates a ghost of its schedules
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- redis, typescript
- Ambito
- backend
Direzione di ricerca
Start with the scheduler configuration in devvit.json, the route shown in index.ts, and the scheduler.listJobs() result. Reproduce the install, uninstall, and reinstall sequence, then trace which scheduled jobs remain and how the Redis-stored widget ID is used. Done means uninstalling removes prior schedules so reinstalling leaves only the current job and does not create duplicate widget updates.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Reddit does not properly clean up apps when they are uninstalled.
You can reproduce this by adding a schedule in your devvit.json. like so:
"scheduler": {
"tasks": {
"daily-guides": {
"endpoint": "/internal/scheduler/daily-guides",
"cron": "* * * * *"
}
}
},
Then, configure a route to handle it:
// index.ts.
router.post("/internal/scheduler/daily-guides", scheduleFunction);
// Maybe in another file...
import { context, reddit, redis } from "@devvit/web/server";
export async function scheduleFunction() {
const widgetId = await redis.get('schedule-key');
if (!widgetId) {
console.info("Widget not found. Creating one.");
const widget = await reddit.addWidget({
subreddit: context.subredditName,
type: "textarea",
shortName: "Countdown",
text: "test",
});
await redis.set('schedule-key', widget.id);
return;
}
await reddit.updateWidget({
subreddit: context.subredditName,
type: "textarea",
id: widgetId,
shortName: "Countdown",
text: "test",
});
}
Then:
- Install the app to a subreddit
- Uninstall it after several minutes
- Install the app to the aforementioned subreddit
After a few minutes after step 3, you'll have a mod log like this:
It looks like the first scheduled has returned and it is updating the widget from the id stored in Redis somehow. It shouldn't know that it is still there. Then, it starts a new schedule from installation, creating a widget since it doesn't know anything about the subreddit which is expected behaviour, stores the widget id in Redis, and proceeds to edit it. This leads to 2 widgets.
If you run await scheduler.listJobs();, only 1 job would be listed–the job you started your application with to log that in the first place–not 2. The other schedule is now a ghost–you cannot find it, you cannot stop it, you cannot uninstall your application as a workaround as demonstrated above... it's totally broken.
I'd appreciate if a lurking administrator can resolve my prior schedules (my application is in the above screenshot)!
- Lingua principale
- TypeScript
- Stelle
- 217
- Fork
- 89
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reddit/devvit
-
redis.expireTime() returns relative TTL seconds on live host instead of Unix timestamp secondsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
Bound concurrent filesystem reads during asset discovery and source ZIP generationForse già presa @CR29-22-2805 l’ha presa 139 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Tutte le issue di reddit/devvit
Issue simili
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-js#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
agent/quality testing
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
juspay/agent-distro#203 ·
I maintainer di solito rispondono entro 1 giorno