Channel health status and a repair action for stale community ids #145
Labels
No labels
bug
devops
duplicate
enhancement
good first issue
layout
next major release
next minor release
question
research
testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/fedi-feed-router#145
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Publishing to Lemmy fails with
couldnt_find_communitybecause channels holdcommunity ids that no longer resolve on their instance. Nine failures were
observed on 2026-08-14 between 17:42 and 18:06.
The local
newsbottestandnewschannels hold community ids 101 and 102,while the instance reports 217 and 8.
Root cause
The migration
2024_01_01_000015_store_numeric_community_id_on_platform_channelsfailed during the v1.3.7 deploy. A Lemmy login returned
login_token_pkeyduring the migration, so the numeric community ids were never resolved and the
channels were left holding whatever was there before.
This is a one-off deploy failure rather than an ongoing bug in the resolution
code, but nothing in the app surfaces the resulting broken state, and nothing
offers a way to fix it.
Why it cannot be fixed through the UI today
Deleting and recreating the channel is currently the only route, and #141
"Delete channels from the UI, with a defined cascade" deliberately made that
possible for exactly this reason.
The channel edit modal has no community selector. This is deliberate: the
community and instance pairing is treated as immutable once created
(
resources/views/livewire/channels.blade.php:342andapp/Livewire/Channels.php:186both state this). Only the create modal offerscommunity selection.
So a user whose channel has a stale id must delete it, losing its routes,
keywords, route articles and publications through the cascade, and recreate it.
That is a heavy fix for a stored value that has simply gone out of date.
Proposed
Two parts, both scoped to avoid reopening the "should channels be editable"
question:
1. Channel health status. Check whether a channel's stored community id
still resolves on its instance, and surface the result on the channel card.
LemmyApiService::resolveCommunityId()already does the lookup. A scheduledcheck would fit alongside
CheckPlatformCredentialsJob, which already runsdaily and reports account health the same way.
2. Repair action. Where a channel is unhealthy but its community name still
resolves, offer a per-channel action to re-resolve and store the correct id.
This repairs the pairing without making it freely editable: the community is
not being changed, only the stored id corrected to match what the instance
reports for the same community.
Open questions
channel card? A stale id only changes when something upstream changes, so
daily is likely enough, but on-demand gives the user a way to confirm a fix.
upstream cannot be repaired by re-resolving, and needs delete-and-recreate.
The status should distinguish "id is stale, repairable" from "community is
gone".
publish would fix this class of failure without user involvement, but hides a
state change the user may want to know about.
Acceptance criteria
as unhealthy in the UI
no longer exists
channel
broken state
community, and repair restoring publish capability
LemmyApiServicenotes in.claude/PLATFORM.mdRelated
channels entering this state but does nothing for existing ones
all
Closing: superseded by the approach taken in #150.
Migration
000015no longer resolves community ids against the instance. Itdeletes channels whose
channel_idis still a slug and keeps the numeric ones,so after it runs a channel either holds a valid id or does not exist. There is
no unresolved state left to detect or repair, and the repair action this ticket
proposed has nothing to act on.
Channels are recreated through the Channels page, which already validates that
the community exists on the instance (#114), so a recreated channel cannot enter
the broken state this ticket described.
The narrower concern behind this ticket still exists in principle: a community
id that is valid at creation could go stale later if the community is deleted or
the instance renumbers. That has not been observed, and the failure is now
visible on the Failed tab (#142) rather than silent. Worth a fresh ticket if it
ever happens, rather than keeping this one open against a state the schema no
longer permits.