Bug: Moderation.Distinguish fails on ever-edited comments — RedditObject.edited is BoolValue but Reddit returns a float timestamp
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- api, backend-api-design
Línea de trabajo
Start with common/common_msg.d.ts and common/common_msg.js to inspect RedditObject.edited and its BoolValue encoding, then review moderation_svc.d.ts and moderation_msg.d.ts for the response path. Run the edit-then-distinguish reproduction. Done means edited comments no longer cause the response RPC to fail and the distinguish result still populates its model fields.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Calling comment.distinguish(true) on a comment that has ever been edited rejects with a gRPC
status-2 error from the platform, even though the distinguish/sticky is actually applied on Reddit.
The root cause is a protobuf contract mismatch: Reddit's API returns edited as false or a float
epoch timestamp, but Devvit's RedditObject.edited is declared google.protobuf.BoolValue, so the
gateway fails to marshal the (successful) response.
Environment
- App:
confessor-mod, installed on r/confession - SDK:
@devvit/web0.13.6 (@devvit/protos0.13.6; flaw still present in latest@devvit/protos0.13.10) - Observed in production: 2026-07-28 ~07:07 UTC
Observed error
[remove] sticky distinguish failed: Error: 2 UNKNOWN: grpc invocation failed with status 2; proto: (line 1:182): invalid value for bool field value: 1785222440.0
at callErrorFromStatus (/srv/index.cjs:5452:21)
at Object.onReceiveStatus (/srv/index.cjs:6133:70)
...
at GenericPluginClient.Distinguish (/srv/index.cjs:137177:93)
at tM.distinguish (main.js:6:10378)
at tM.distinguish (main.js:6:8096)
code: 2,
details: 'grpc invocation failed with status 2; proto: (line 1:182): invalid value for bool field value: 1785222440.0'
Note 1785222440.0 = 2026-07-28T07:07:20Z — the exact time the app had just edited the comment
before distinguishing it. It is the comment's edited timestamp, not anything the app passed: the
app called comment.distinguish(true) with a literal boolean, and @devvit/reddit's
Comment.distinguish sends only { id, how: 'yes', sticky: true }, which matches
DistinguishRequest (moderation_msg.d.ts:65-72). The failure is in the response path.
Root cause
Moderation.Distinguish returns JsonRedditObjects (moderation_svc.d.ts:34), whose
things[].data is RedditObject (common/common_msg.d.ts). In that message:
approvedAtUtc,bannedAtUtc,created,createdUtcare correctly typed as numbers, buteditedis declared as a bool wrapper:edited?: boolean | undefined(common_msg.d.ts:207-208),
encoded asgoogle.protobuf.BoolValue(common_msg.js:841-842:
BoolValue.encode({ value: message.edited }, ...)).
Reddit's API returns edited: false for never-edited things and edited: <float epoch> for edited
things. When the gateway converts Reddit's JSON response for a distinguish call into the proto, an
edited comment's timestamp cannot unmarshal into BoolValue — hence the Go protojson error naming
the wrapper's inner field: invalid value for bool field value: 1785222440.0.
Consistent with this, the error only reproduces on the edit-then-distinguish path; distinguishing
a freshly created comment (edited: false) works.
Reproduction
const comment = await post.addComment({ text: 'hello' });
await comment.distinguish(true); // OK — edited is false
const edited = await comment.edit({ text: 'hello (edited)' });
await edited.distinguish(true); // throws: 2 UNKNOWN ... invalid value for bool field value: <timestamp>
Impact
- The RPC rejects, but the distinguish is applied on Reddit — the error is raised while
marshaling the post-action comment JSON that Reddit returned, i.e. after the action succeeded.
Apps get a spurious failure for an operation that worked, and the model fields the SDK updates from
the response (distinguishedBy,stickied) are never populated. - Affects any thing that has ever been edited (the
editedtimestamp is permanent), for every RPC
whose response isJsonRedditObjects/RedditObject:Moderation.Distinguish(comments and
posts, includingundistinguish/distinguishAsAdmin) andLinksAndComments.EditCustomPost. - Any app that maintains a pinned/sticky bot comment by editing it in place and re-distinguishing
will log this failure deterministically.
Expected behavior / suggested fix
RedditObject.edited should accommodate Reddit's false | float union — e.g. type it as
google.protobuf.Value, or as a double with false normalized to unset — or the gateway should
coerce edited to truthiness before marshaling the response.
Workaround in the meantime
Treat distinguish failures matching invalid value for bool field value: <number> as
likely-succeeded (optionally verify by re-fetching the comment and checking stickied /
distinguishedBy).
This bug was diagnosed and this report written by Claude (Claude Code, Anthropic), working from the app's production logs and the installed @devvit packages, at the app maintainer's request.
- Lenguaje dominante
- TypeScript
- Estrellas
- 211
- Forks
- 89
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de reddit/devvit
-
Bound concurrent filesystem reads during asset discovery and source ZIP generationPosiblemente ocupada @CR29-22-2805 la tomó hace 76 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
requestExpandedMode(event, "game") does not switch inline webview to the game entrypoint in PlaytestAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de reddit/devvit
Issues similares
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
LucasSantana-Dev/Lucky#2637 ·
Los mantenedores suelen responder en 1 día
-
Show the error reference on the error pagePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
tomjn/coilbox-hub#454 ·
Los mantenedores suelen responder en 1 día
-
Scheduler button hover stateAbiertofrontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
icssc/peterportal-client#1224 · 1 comentario ·
-
testplan-item
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día