Skip to content

Remove the old Resource surface and the _v2 method scaffolding - #15233

Open
rtibblesbot wants to merge 6 commits into
learningequality:developfrom
rtibblesbot:issue-15068-679ea1
Open

rtibblesbot wants to merge 6 commits into
learningequality:developfrom
rtibblesbot:issue-15068-679ea1

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Delete the Model/Collection layer, its read-through JS cache, the force escape hatch, and the old base methods from Resource.
  • Restore every _v2 custom method to its original name, replacing the old implementation.
  • Reads no longer serve cached data.
  • Rewrite the two resource-layer docs pages and the sandbox README around the surviving methods.

References

Closes #15068.

Reviewer guidance

  1. Device > Channels > Import, with network access to Kolibri Studio: the Studio option enables once its availability check returns; pick topics on Select content and import. The task runs to completion, and the finished task is gone when you return to Manage content.
  2. Device > Tasks: start an import, cancel it mid-run, restart it, clear the finished task, then Clear all. Each state holds across a reload. Pick a channel of at least 500 MB — anything smaller finishes before you can cancel it.
  3. Device > Channels on a channel imported at an older version: the new-version page polls the update task, cancelling mid-update leaves the channel on its old version, and the task is cleared afterwards.
  4. Device > Facilities > Import facility, with a second Kolibri device on the network: the picker lists that device's facilities and refreshes its connection status. The facility task can then be retried, removed, and cleared via Clear all.
  5. Facility > Data: sync the facility to a peer through the device picker, then import and export users by CSV. Each task reports progress and clears afterwards; the exported CSV holds one row per facility user.
  6. Setup wizard on a fresh device with its own KOLIBRI_HOME and port (not .reviews/self-qa-state): every step advances, the provisioning task completes, and you land signed in on the Device page.

StaticNetworkLocationResource and DynamicNetworkLocationResource lose updateConnectionStatus and fetchFacilities: they shared the deleted module-level implementations and had no _v2 siblings. No in-tree callers, but an out-of-tree plugin calling them would break.

AI usage

Used Claude Code to execute the removal resource by resource, updating each call site and spec alongside the method it renamed. Verified with the full frontend test suite and prek.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks

Deviations from the issue spec

Criterion Why not
Remove the raw get / list / create Only get was an old method and it is removed. list and create are the new request-based methods — there was never an old pair under those names.
@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-09-14 17:06 UTC

@github-actions github-actions Bot added APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: frontend SIZE: very large labels Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

npm Package Versions

Warning

The following packages have changed files but no version bump:

Package Version Changed files
kolibri-i18n 1.0.0 1
kolibri 0.18.0 3

If these changes affect published code, consider bumping the version.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@rtibblesbot
rtibblesbot force-pushed the issue-15068-679ea1 branch 3 times, most recently from 80274fd to a488f2b Compare August 31, 2026 15:18
@rtibblesbot
rtibblesbot marked this pull request as ready for review August 31, 2026 15:32
@rtibblesbot
rtibblesbot force-pushed the issue-15068-679ea1 branch 2 times, most recently from 8363463 to 73b1f0d Compare August 31, 2026 15:52
@AlexVelezLl AlexVelezLl self-assigned this Sep 8, 2026
@rtibblesbot
rtibblesbot force-pushed the issue-15068-679ea1 branch 2 times, most recently from 57ad048 to ca1ff3d Compare September 8, 2026 20:35

@AlexVelezLl AlexVelezLl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @rtibblesbot. Could you please rebase on top of develop? Just merged #15234.

rtibblesbot and others added 5 commits September 14, 2026 07:36
Both facility list endpoints set no pagination_class, so list() resolves
with the same bare array Collection.data did.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Delete the old client-based implementations; the _v2 bodies keep the
bare names.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Delete the fetchModel/fetchCollection overrides along with the old
custom methods; the _v2 bodies keep the bare names.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Drop the _v2 suffix across eight resources, deleting the old
implementations. NetworkLocationResource's shared updateConnectionStatus
and fetchFacilities go with them: the static and dynamic variants had no
callers, and staticnetworklocation_facilities_detail was never a
registered URL.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Removes the read-through JS cache along with it: the surviving methods
coalesce concurrent identical GETs but never serve stale data.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Rebased on develop (through #15234).

#15234 landed one new _v2 call site: commonSyncElements.fetchNetworkLocationFacilities calls NetworkLocationResource.fetchFacilities_v2, which this branch renames to fetchFacilities. Folded the fix into the commit that did that rename.

Swept the whole tree for the same class rather than just that one call: _v2 across packages/, kolibri/, docs/ (1 real match, fixed; 2 unrelated QTI fixture identifiers), each removed base and cache method by name (0 matches), and every apiResource import (all Resource — no Model/Collection).

Full Jest suite: 5885 passed. The one failure, FacilityPermissionsForm.spec.js, is a parallel-load flake — untouched by this branch and passing on its own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Facility Re: Facility App (user/class management, facility settings, csv import/export, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) APP: User Re: User app (sign-in, sign-up, user profile, etc.) DEV: frontend SIZE: very large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the old Resource-layer methods and un-suffix the _v2 custom methods

2 participants