Repository navigation
Link health: Broken filter, badge, settings and Check links action - #2
Open
sincere-arjun wants to merge 9 commits into
Open
sincere-arjun wants to merge 9 commits into
sincere-arjun wants to merge 9 commits into
Conversation
Adds the shared contract for periodic link health checks: Bookmark link_* fields and UserProfile settings (migration 0055), LD_LINK_CHECK_TIMEOUT and LD_LINK_CHECK_HOST_DELAY settings, the link_health checker service, huey tasks including the periodic scheduler, check_bookmark_links and the BookmarkSearch "broken" filter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scheduled link health check tasks now carry a not_checked_since timestamp, so bookmarks that were checked after being scheduled are skipped instead of being checked again when the queue is backed up. Adds tests for the scheduler and task enqueueing, check_bookmark_links, the BookmarkSearch broken param and the broken query filter, and documents the LD_LINK_CHECK_TIMEOUT and LD_LINK_CHECK_HOST_DELAY options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Settings: "Link health" group in the profile form with enable_link_health_checks and link_health_check_interval. - Search preferences: "Link health filter" radio group (Off/Broken) using the BookmarkSearchForm "broken" field; marks the preferences button as modified when active and is kept as hidden field in other forms. - Bookmark list: "Broken" badge (.link-broken-badge) for bookmarks with link_broken, title shows status code or check error and last check time. - Bulk edit: "Check links" action (bulk_check_links) calling check_bookmark_links. - Tests for settings, filter, badge and bulk action, plus a Playwright e2e test (e2e_test_link_health.py) covering all four in the browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
record_result now writes with a queryset update instead of save(update_fields=...), so a bookmark deleted while its link is being checked no longer raises, aborts the batch and makes huey retry it (which counted failures twice for Check now). The failure count is incremented atomically with F(), so concurrent checks of the same bookmark don't lose failures. Also test that the scheduler is registered as a periodic huey task every 15 minutes, and clarify what LD_LINK_CHECK_HOST_DELAY actually limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ders - Only expose link health (Broken badge, status/error title, link-broken class) to the bookmark owner, so it no longer shows on the shared page or the public share. - Shared views ignore the broken filter: it neither filters shared bookmarks nor is carried through forms on the shared page. - Badge reason (status/error and last checked) is available to screen readers via a visually hidden description; visible text stays "Broken". - Tests: shared view (logged in and anonymous) shows no link health of other users and ignores ?broken=yes, Save as default does not persist the broken filter, badge accessible description, and an e2e test for the shared page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The public shared bookmarks API (AllowAny) built its search from the request, so ?broken=yes let anyone list which shared links are dead. query_shared_bookmarks now skips the broken filter; the owner's own active and archived queries still apply it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared page search preferences only offer sorting, so the link health filter is not shown there. Add view tests (logged in and anonymous) and an e2e check of the dropdown to keep it that way, and check that the owner's active and archived pages still render it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Frontend for periodic link health checks:
broken=off|yes) next to the Shared and Unread filters. It is carried through the search, sort, pagination and bundle links and marks the preferences button as active. It is not saved by "Save as default" (it's a filter, not a preference)..link-broken-badge, text "Broken") on broken bookmarks. The reason (status code or check error, plus last-checked time) is in the title and in a visually hidden description referenced byaria-describedby, so screen readers get it too. List items also get alink-brokenclass.bulk_check_links) on the active and archived pages, callingcheck_bookmark_links(bookmark_ids, request.user)(owner-only).?broken=yes.Depends on #1
This builds on #1 (backend: models, checker and background tasks) and contains its commits via a merge of its current head (
d95a8c4). Please review and merge it after #1.Tests
make test: 1440 passedmake lint: cleanbookmarks/tests_e2e/e2e_test_link_health.py: 5 passed (recorded). It covers the settings group, the badge, the Broken filter, the Check links action (task mocked) and the shared page. It only uses the local live server, with no network access.Known gap: search suggestions while typing come from the REST API and don't take the Broken filter into account. Submitting the search applies it.
Refs: upstream linkding issue 68 (sissbruecker/linkding, not linked on purpose).
🤖 Generated with Claude Code