Repository navigation
Sync kolibri_public when a channel is made public, private or deleted - #6475
Open
rtibblesbot wants to merge 1 commit into
Open
rtibblesbot wants to merge 1 commit into
rtibblesbot wants to merge 1 commit into
Conversation
- Channel schedules sync_channel_to_kolibri_public_task after commit when public or deleted changes on a public channel, and on hard delete - The task exports a published public channel, or deletes its public kolibri_public rows, under a per-channel advisory lock - export_channels_to_kolibri_public called the module, not the function, so every export failed Fixes learningequality#6469 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rtibblesbot
marked this pull request as ready for review
November 26, 2026 02:23
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.
Summary
A channel made public after its last publish shows in Kolibri's Device import but not in Learn's Explore libraries. Making a channel private or deleting it never removed it from the public v2 API, and
export_channels_to_kolibri_publicfailed on every channel.A background task now exports a published channel to
kolibri_publicwhen it becomes public, and deletes its public rows when it becomes private or is deleted. The management command exports again.References
Fixes #6469. Related: #6470.
Reviewer guidance
Suggested review: Full code review, then manual QA once the reviewer sets Needs QA.
Engineer review
kolibri_publicrows back when the publish maps (contentcuration/utils/publish.py:204).If-Modified-Sincealone still gets 304 after a removal (kolibri_public/views.py:63).--channel-idnow exports only channels that are public and published in the local DB, which drops 2eece7e's export of channels absent locally (kolibri_public/management/commands/export_channels_to_kolibri_public.py:51).kolibri_public/utils/export_channel_to_kolibri_public.py:105-111); confirm that suits the largest public channels.apply_asyncwith no user orCustomTaskMetadata, so task tracking never sees it (contentcuration/models.py:1423); others will copy it.Engineer evidence
/api/public/v2/channel/<id>/returns 200./api/public/v2/channel/<id>/returns 404./api/public/v2/channel/<id>/returns 404.python manage.py export_channels_to_kolibri_public --channel-id <id>on a published public channel./api/public/v2/channel/<id>/returns 200.For the by-hand backfill, use
--channel-id: the no-argument form also republishes public channels with a null or pre-2019last_published.Open questions:
--channel-idnow skips channels that are not public and published in the local database; previously it exported channels absent locally.QA review
/api/public/v2/channel/<id>/returns 200 and Kolibri Learn → Explore libraries lists it./api/public/v2/channel/<id>/returns 404 and Explore libraries drops it./api/public/v2/channel/<id>/returns 404.AI usage
Used Claude Code to plan the change, write the code and tests, and draft this description. Verified with the full test suite and pre-commit.
Written by rtibblesbot, an LLM-based coding agent.
🟡 Waiting for feedback
WAITING · for reviewLast updated: 2026-11-26 02:25 UTC