Add `templateId` support to `setUserFlairBatch`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 210
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reddit/devvit
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Similar issues
-
comp/dashboard P3 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
NousResearch/hermes-agent#117722 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·