kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

SelectContentPage not being able to import more resources from draft channels

Open AlexVelezLl opened this issue 7 months ago • 1 comments

❌ 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:

  1. "Channel not found" error: When Studio returns HTTP 404 (because the channel has no published version), SelectContentPage displays a full-page "Channel not found" error, blocking access to the content tree entirely.

  2. ContentTreeViewer hidden: When Studio returns a published version (v ≥ 1) for a channel whose installed version is 0, newVersionAvailable evaluates to true. This shows the NewChannelVersionBanner (prompting the user to revert the draft import to the live published version), but also hides both ContentTreeViewer and SelectionBottomBar, making it impossible to browse or import content from the draft in the meantime.

Expected behavior

  1. When Studio returns HTTP 404 for a draft channel (version = 0) that is already imported on the device, SelectContentPage should 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.

  2. When a published version (v ≥ 1) exists on Studio for a locally installed draft channel (version = 0), ContentTreeViewer and SelectionBottomBar should remain visible so the user can still browse and import content from the draft. The NewChannelVersionBanner should 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:

  1. Import a draft channel (version = 0) onto a Kolibri device via a token.
  2. Navigate to Device > Channels, open the channel, and click Import more.
  3. Select Kolibri Studio as the import source.
  4. Observe that SelectContentPage shows a full-page "Channel not found" error instead of the content tree.

Bug 2 — ContentTreeViewer hidden when a published version exists on Studio:

  1. Import a draft channel (version = 0) onto a Kolibri device via a token.
  2. Ensure a published version (v ≥ 1) of the same channel exists on Studio.
  3. Navigate to Device > Channels, open the channel, and click Import more.
  4. Select Kolibri Studio as the import source.
  5. Observe that NewChannelVersionBanner is shown, but ContentTreeViewer and 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, SelectContentPage does not show "Channel not found" — it falls back to on-device channel data and renders the content tree normally.
  • [ ] ContentTreeViewer and SelectionBottomBar are always visible on SelectContentPage when the locally-installed channel version is 0, regardless of whether a newer published version exists on Studio.
  • [ ] NewChannelVersionBanner is 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 ContentTreeViewer and 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.

AlexVelezLl avatar Apr 29 '26 17:04 AlexVelezLl

Watching for resolution on behalf of learningequality/kolibri#14658.

rtibblesbot avatar Apr 30 '26 20:04 rtibblesbot