Facilities on a peer below 0.19.4 are silently dropped, hiding the device from every facility picker
❌ 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 (also every release since v0.19.4)
Observed behavior
- A device on 0.19.4+ never lists a peer running an older Kolibri in any facility picker: Device > Facilities > Import facility, the sync-schedule device selection, LOD user import, and the setup wizard's facility import.
GET /api/discovery/networklocation_facilities/<peer-id>/returns200with"facilities": []for that peer, sodeviceHasMatchingFacilityfilters it out.- Importing content from the same peer works, because that path never calls the endpoint.
_RemoteFacilitySerializer(kolibri/core/discovery/viewsets/network_location.py:161) requirespicture_password_settings, whichPublicFacilitySerializeronly began emitting in v0.19.4 (v0.19.3payload:id,dataset,name,learner_can_login_with_no_password,learner_can_sign_up,on_my_own_setup).facilities = serializer.data if serializer.is_valid() else []overmany=Trueis all-or-nothing: one unparseable facility empties the whole list, and the caller cannot tell that apart from a peer with no facilities.
Errors and logs
Nothing is logged — the failure is a silent []. Against the serializer directly:
>>> S(data=[{'id': '…03', 'dataset': '…04', 'name': 'Peer Facility',
... 'learner_can_login_with_no_password': False,
... 'learner_can_sign_up': True, 'on_my_own_setup': False}], many=True).is_valid()
False
errors: [{'picture_password_settings': [ErrorDetail(string='This field is required.', code='required')]}]
Adding picture_password_settings: None to the same payload validates.
Expected behavior
A peer whose facility payload predates a field still has its facilities listed, and the device is selectable in the facility pickers.
User-facing consequences
- A facility cannot be imported from, nor a sync scheduled to, any device running below 0.19.4 — the upgrade path an admin would use to bring an old device forward.
- The device is simply absent from the list, with no error to act on, so it reads as a discovery or network problem.
Steps to reproduce
- Run two Kolibri instances on one network, one on 0.18.4 or 0.19.3 with a facility, the other on develop.
- On the develop instance, wait for the peer to be discovered under Device > Facilities.
- Open Add facility > Import facility.
- The peer is missing from the device list;
GET /api/discovery/networklocation_facilities/<peer-id>/returns"facilities": [].
Context
- Found during QA of #15163 with a 0.18.4 peer on Ubuntu 20.04 against a develop build on Ubuntu 22.04.
- Introduced by bf14f672b0 "Sanitize remote facility list in NetworkLocationFacilitiesView", first released in v0.19.4.
- Two sibling sites validate a remote peer's payload the same all-or-nothing way:
kolibri/core/auth/utils/users.py:98(which then indexesauth_info[0]) andkolibri/plugins/setup_wizard/viewsets/setup_wizard.py:77.
Acceptance Criteria
- [ ] A peer running below 0.19.4 has its facilities listed by
networklocation_facilities, and is selectable in the facility import, sync-schedule, LOD user import and setup-wizard pickers. - [ ] A facility entry that fails validation does not discard the entries that validated.
- [ ] The two sibling remote-payload validations behave the same way, and
get_remote_users_infodoes not index an empty list. - [ ] A test covers a remote payload missing a field the local version emits.
AI usage
Claude Code diagnosed and filed this while working PR #15163. The reproduction came from @radinamatic's QA of that PR; I confirmed the cause by running _RemoteFacilitySerializer against a v0.19.3-shaped payload and by reading PublicFacilitySerializer at the v0.19.3 and v0.19.4 tags, then wrote the issue from those results.
Plan: A peer running below Kolibri 0.19.4 has its facilities listed by networklocation_facilities and is selectable in every facility picker.
- [ ] Per-item validation of the remote facility list
- [ ]
get_remote_users_infostops indexing an empty list - [ ] The remaining two remote-payload sites
- [ ] Self-review the produced code
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
- Ran the project's full test suite and linter before committing
- For UI changes: captured live screenshots to verify rendering
- For backend changes: verified with example API/CLI output