kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Peers keep the old channel list for up to an hour after the unlisted-channels setting changes

Open rtibblesbot opened this issue 1 week ago • 0 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: develop

Observed behavior

  • On a server whose only channel is unlisted, ticking Device > Settings > Allow other devices on this network to view and import my unlisted channels and pressing Save changes does not change what peers see.
  • GET /api/public/v2/channel/?available=true kept returning [] after the save. The same endpoint without the query string, which nothing had cached, returned the channel.
  • On a peer, Learn > Library kept showing "No other libraries around you right now", and peer routes into the channel redirected to "No resources available".
  • The responses are cached by public_metadata_cache for 3600 s, keyed on ContentCacheKey (cache.py). Saving device settings does not change that key.
  • Both public endpoints that read the setting are affected: channel_metadata.py#L195-L199 and contentnode/base.py#L376-L383.

User-facing consequences

  • After an admin shares their unlisted channels, learners on other devices and admins importing from a peer see no channels for up to an hour. Nothing on screen explains the delay.
  • Turning the setting off keeps the unlisted channels visible to peers for the same time.

Steps to reproduce

  1. On server A, import an unlisted channel by token and import nothing else. Leave the unlisted-channels setting off.
  2. From server B on the same network, open Learn > Library (or Device > Channels > Import > Local network) and select server A. No channels are listed.
  3. On A, tick Allow other devices on this network to view and import my unlisted channels → Save changes.
  4. Repeat step 2 on B straight away. Still no channels.

Context

  • Seen on Kolibri 0.20.0a2 (dev server, Linux, Chromium), with a learn-only device as the peer.

Acceptance Criteria

  • [ ] After step 3, step 4 lists A's unlisted channel without waiting for the cache to expire.
  • [ ] After turning the setting off, peers stop seeing A's unlisted channels and their content nodes on the next request.
  • [ ] A test fails if changing the setting leaves the public channel or content node response unchanged.

AI usage

Claude Code hit this during QA of a Bloom Player PR, traced the cause in the source, and drafted this issue.

rtibblesbot avatar Nov 26 '26 10:11 rtibblesbot