SelectContentPage not being able to import more resources from draft channels
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Target branch: release-0.19.x
Observed behavior
Two related bugs affect SelectContentPage when a draft channel (version = 0) is already imported on the device and the user clicks Import more via Kolibri Studio:
-
"Channel not found" error: When Studio returns HTTP 404 (because the channel has no published version),
SelectContentPagedisplays a full-page "Channel not found" error, blocking access to the content tree entirely. -
ContentTreeViewerhidden: When Studio returns a published version (v ≥ 1) for a channel whose installed version is 0,newVersionAvailableevaluates totrue. This shows theNewChannelVersionBanner(prompting the user to revert the draft import to the live published version), but also hides bothContentTreeViewerandSelectionBottomBar, making it impossible to browse or import content from the draft in the meantime.
Expected behavior
-
When Studio returns HTTP 404 for a draft channel (version = 0) that is already imported on the device,
SelectContentPageshould silently fall back to the on-device channel data and render the content tree normally, allowing the user to browse and import more resources from the currently imported channel version. -
When a published version (v ≥ 1) exists on Studio for a locally installed draft channel (version = 0),
ContentTreeViewerandSelectionBottomBarshould remain visible so the user can still browse and import content from the draft. TheNewChannelVersionBannershould continue to be shown.
User-facing consequences
Admins who have imported a draft channel (version = 0) onto a device are completely blocked from importing additional content from it — the only workaround is to remove the channel entirely and re-import it from scratch. This makes iterative content testing workflows impractical for content creators and admins working with draft channels.
Steps to reproduce
Bug 1 — "Channel not found" when no published version exists on Studio:
- Import a draft channel (version = 0) onto a Kolibri device via a token.
- Navigate to Device > Channels, open the channel, and click Import more.
- Select Kolibri Studio as the import source.
- Observe that
SelectContentPageshows a full-page "Channel not found" error instead of the content tree.
Bug 2 — ContentTreeViewer hidden when a published version exists on Studio:
- Import a draft channel (version = 0) onto a Kolibri device via a token.
- Ensure a published version (v ≥ 1) of the same channel exists on Studio.
- Navigate to Device > Channels, open the channel, and click Import more.
- Select Kolibri Studio as the import source.
- Observe that
NewChannelVersionBanneris shown, butContentTreeViewerand the import bottom bar are hidden, making it impossible to select or import content.
Acceptance Criteria
- [ ] When Studio returns 404 for a channel whose locally-installed version is 0,
SelectContentPagedoes not show "Channel not found" — it falls back to on-device channel data and renders the content tree normally. - [ ]
ContentTreeViewerandSelectionBottomBarare always visible onSelectContentPagewhen the locally-installed channel version is 0, regardless of whether a newer published version exists on Studio. - [ ]
NewChannelVersionBanneris still shown when a published version (v ≥ 1) is available on Studio, even for draft channels (version = 0). - [ ] Existing behavior for non-draft channels (version ≥ 1) is unchanged: a newer Studio version still hides
ContentTreeViewerand shows the upgrade prompt.
AI usage
Used Claude Code to help draft this issue interactively. I described the bugs and provided the relevant code locations. Claude explored the codebase to confirm root causes in handlers.js and SelectContentPage/index.vue. All content reflects my decisions and was reviewed section by section.
Watching for resolution on behalf of learningequality/kolibri#14658.