Migrate the facility plugin to the new resource methods - #15184
Open
rtibblesbot wants to merge 5 commits into
Open
Migrate the facility plugin to the new resource methods#15184rtibblesbot wants to merge 5 commits into
rtibblesbot wants to merge 5 commits into
Conversation
Contributor
Build Artifacts
Smoke test screenshot |
rtibblesbot
force-pushed
the
issue-15062-fbe9fc
branch
2 times, most recently
from
August 12, 2026 17:11
39f2b74 to
7f68609
Compare
rtibblesbot
marked this pull request as ready for review
August 12, 2026 21:11
The Model/Collection cache goes with them, so every read that did not pass `force: true` now hits the network. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The resource is imported only by facility, so the recipe's in-place rewrite applies rather than a `_v2` sibling. It now resolves with the payload instead of the axios response, and failures are logged by `request`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Four behaviour changes come with useFetch: `dataLoading` clears on failure rather than spinning forever, `usersCount`/`totalPages` normalise to 0 instead of undefined, a superseded fetch's response is discarded, and failure handling runs from a watcher a tick later instead of a catch. `fetchClasses` stays a plain `list()` — `useUsersFilters` dereferences the `classes` ref before any fetch runs, and `useFetch` initialises `data` to null. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
It duplicates packages/kolibri-common/apiResources/PortalResource.js and has no importers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
member_of, related_to__in and user_type joined memberships and roles, returning a user once per matching row - a learner in two classes appeared twice. The legacy Collection cache deduplicated by id client-side, hiding it until the resource migration. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rtibblesbot
force-pushed
the
issue-15062-fbe9fc
branch
from
August 12, 2026 21:21
7f68609 to
e08ef88
Compare
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
facilitymoves to the newResourcemethods, andDeletedFacilityUserResource.restoreCollectionis rewritten ontorequest.useList.PortalResource.member_of,related_to__inanduser_typefilters OR-ed a multi-valued relation, returning a user once per matching membership or role.id__in=<subquery>.References
Fixes #15062. Recipe: #15057.
Reviewer guidance
composables/useUserManagement.js:68— check the stale-page 404 redirect cannot loop, now that error handling runs in awatchrather than acatch.kolibri/core/auth/viewsets/facility_user.py:112— check no caller relied on these filters returning a row per membership or role.setup()reads keeplist(): their loading ref is also set by a write path, whichuseListcannot do. Check that beats refactoringMoveToTrashModal.vue:90,AssignCoachesSidePanel.vue:178,EnrollLearnersSidePanel.vue:176,ClassCopyModal.vue:178.force: truenow hit the network every time. Check that is acceptable for the side panels, which refetch on open.Duplicate row on the users page:
Pages exercised live:
AI usage
Used Claude Code to apply the migration recipe call site by call site, then to diagnose the duplicate row it surfaced. Verified with the facility and kolibri-common Jest suites, the auth Python suite, prek, and live QA in a browser.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟡 Waiting for feedback
Last updated: 2026-08-12 22:29 UTC