Starter feed: a deleted message breaks every later update for that issue
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start with writeFeed in src/webhook.ts, then read DiscordError, sendMessage and editMessage in src/discord.ts and compare the recovery path in src/checkin.ts. Update the starter feed handling for a 404 according to whether the issue is open, including during resync. Add the cases to the starter issue feed tests in test/webhook.test.ts; done means the acceptance criteria pass, including preserving behavior for other errors.
Written by the indexing model from the issue text.
Description
The bot keeps one message per starter issue in #starter-issues and edits it when the issue is claimed, freed or closed (writeFeed in src/webhook.ts, line 108). If someone deletes that message in Discord, the stored message id points at nothing:
- every later update for the issue tries to edit it (line 113), Discord answers 404 "Unknown Message", and the webhook returns a 500, because
onIssueonly handles a 429 (line 156) - the cron resync logs "starter issue resync failed" and drops its mark (line 184)
So that issue never comes back to the feed, even when it's free to take again.
Check-ins already handle the same case: when a learner's log thread is gone, postToLog starts a new one (src/checkin.ts, lines 133 to 142).
What to do
- In
writeFeed, wheneditMessagefails with aDiscordErrorwhose status is 404:- if the issue is free to take (
state.kind === "open"), post a new message withsendMessageand store its id - otherwise, delete the stored record, so the issue gets a fresh message once it's free again
- if the issue is free to take (
- Other errors work the way they do now: a 429 still goes to the resync.
Where to look
src/webhook.ts:writeFeed(line 108),onIssue(line 122) andresyncStarterIssues(line 163)src/discord.ts:DiscordError(line 43),sendMessage(line 118) andeditMessage(line 131)src/checkin.ts:postToLog(line 128)test/webhook.test.ts: the starter issue feed tests (line 62)
Acceptance criteria
- When the stored message is gone and the issue is free, an update posts a new message, stores its id, and the webhook answers 200
- When the stored message is gone and the issue isn't free, the stored record is removed and the webhook answers 200
- The resync handles the same two cases
- Other Discord errors behave as before
- Tests for these cases
-
npm run typecheckandnpm testpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #58 in the description.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 12h 22m
- Merged PRs (30d)
- 36
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 codercops/discord-bot
-
Merged PR shoutout: ask people who haven't linked their GitHub to run /linkPossibly taken @princecherry9905 claimed this today. Openenhancement good first issue hacktoberfest
codercops/discord-bot#66 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Merged PR shoutout misses the count when the program label is added after the mergePossibly taken @An16og claimed this today. Openbug hacktoberfest help wanted
Difficulty 4/5 3-5 days Newbie friendliness 48/100
codercops/discord-bot#59 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Leaderboard page: name the people who qualify but haven't linked their GitHub yetPossibly taken @varun-pahuja claimed this 1 day ago. Openenhancement hacktoberfest help wanted
Difficulty 3/5 1-2 days Newbie friendliness 76/100
codercops/discord-bot#55 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
hacktoberfest
Difficulty 1/5 Under an hour Newbie friendliness 15/100
codercops/discord-bot#15 ·
Maintainers usually reply within 1 day
All issues in codercops/discord-bot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
zts212653/clowder-ai#1678 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Progressive-Victory/the-website#680 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100