Add `templateId` support to `setUserFlairBatch`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- api
Direzione di ricerca
Start by locating the TypeScript implementation and callers of setUserFlairBatch, then compare it with the single-user flair method to understand the existing request shape. Add optional templateId handling without changing behavior for existing callers; done means batches can apply a template to up to 25 users while non-template updates continue to work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Devvit’s batch flair update method does not support templateId. For large subreddits and high‑volume automated systems, this creates a significant operational bottleneck. When a flair template is required, every user must be updated individually because the batch method cannot apply templates.
I propose adding optional templateId support to setUserFlairBatch so that template‑based flair updates can be performed in efficient batches rather than thousands of single‑user calls.
Problem
The single‑user flair method works for small subs and occasional updates. It does not scale for apps that update thousands of users daily.
Streak-Tracker updates the flair of every user once per day. We currently have more than 5.3k users, and the number grows by 30 to 60 users per day. Because the batch method cannot apply a flair template, all updates must be performed through the single‑user method. This results in more than 5.3k API calls every day for flair updates alone.
This creates a compounding operational problem:
- The app must perform thousands of individual flair updates because batch updates cannot apply flair templates.
- Daily flair updates become slower and more fragile as the userbase grows.
- The lack of batching forces unnecessary load on both the app and Reddit’s infrastructure.
As the app scales, this limitation becomes harder to sustain for time‑sensitive workflows that depend on reliable daily flair updates.
Proposed Solution
Add optional templateId support to setUserFlairBatch.
Batch flair updates should be able to apply a flair template to multiple users in a single request. This would allow apps to update up to 25 users per call instead of performing thousands of individual updates.
With batching, daily flair updates would drop from more than 5.3k calls to roughly 212. This is a 96 percent reduction in API usage and would significantly improve reliability for high‑volume systems.
This proposal is intended to improve operational efficiency, not change existing flair behaviour. Apps that do not use templates can continue using the current batch method. Apps that require templates could perform batch flair updates using an optional templateId field.
Use Case
For large subreddits with automated flair systems, batch flair updates with optional templateId support would:
- Reduce daily API usage by thousands of calls.
- Make daily flair updates faster and more predictable.
- Reduce queue congestion for apps that perform other high‑volume tasks.
In my case, optional templateId support in batch flair updates would allow the app to update thousands of users efficiently instead of performing thousands of individual flair updates every day.
This request is motivated by a real scaling need, but the same capability would benefit any Devvit app that performs high‑volume flair updates.
Alternatives Considered
Continuing to use the single‑user flair method is not viable at scale. It forces thousands of unnecessary calls, increases operational fragility, and limits the growth of automated systems that rely on daily flair updates.
Adding optional templateId support to batch flair updates follows the principle of efficiency: apps can perform the same work with far fewer calls, while Reddit’s backend retains full control over flair validation and template behaviour.
- 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
-
GitHub registry install via `gh` credentials rewrites `\u0000`–`\u001f` escapes in source files to `^@`–`^_`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
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