EventSource enum missing in actual runtime
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Start by reproducing the TypeScript example using the @devvit/protos EventSource import and the PostDelete event, then inspect how that package is built and loaded at runtime. Done means EventSource.USER is defined when the uploaded app handles PostDelete events, without breaking the existing import or build behavior.
Written by the indexing model from the issue text.
Description
The PostDelete event contains a source property of the type EventSource. It's exported and available to import from @devvit/protos, but the runtime doesn't seem to match that.
The following code is valid, builds, and uploads:
import {EventSource, PostDelete} from "@devvit/protos";
import {TriggerContext} from "@devvit/public-api";
export async function onPostDelete (event: PostDelete, context: TriggerContext) {
if (event.source !== EventSource.USER) {
return;
}
// handle user deletion...
console.log(`Processing user deletion of ${event.postId}`);
}
However it fails when actually running on Devvit with the error: TypeError: Cannot read properties of undefined (reading 'USER')
This wasn't always the case and is affecting apps that were previously referencing the enum without issues. I am not sure when it went missing, but it was still there a few months ago.
- 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 ·