Skip to content

Adopt and migrate according to Kolibri’s new app hooks in kolibri-app #212

@ozer550

Description

@ozer550

Description

Kolibri PR #12879 deletes the legacy kolibri.plugins.app plugin and replaces it with hook-based capabilities (GetOSUserHook, CheckIsMeteredHook, ShareFileHook).

Wrapper in kolibri-app still depends on the removed plugin, so it can no longer launch or expose app-only features when running against the PR mentioned above. To stay compatible with current and future Kolibri releases, we must migrate to the new hook architecture.

Current Behaviour

  • Following files application.py, server_manager_posix.py, and server_process_windows.py import kolibri plugins app interface, register it and builds initialization URLs.
  • KolibriApp’s kolibri_plugin.py does not implement any of the new core hooks, so capabilities such as OS user login, metered-connection checks, file sharing plugins are never registered.
  • We register the old app plugin and have a dependency on it.

Desired Behaviour

  1. kolibri_app/kolibri_plugin.py registers concrete implementations of the new hooks:
    • GetOSUserHook → Return a fixed desktop pseudo-user so Kolibri can auto-login when the app launches (e.g., ("KolibriDesktopUser", True)). Otherwise return (None, False). eg: here.
    • CheckIsMeteredHook → Return True if the OS reports a metered connection, else False. If the platform can’t detect this, just return False. eg: here.
    • ShareFileHook → Implement share_file(self, filename, message) so the desktop wrapper hands that file off to the OS sharing UX (reveal/open in Explorer/Finder or show a native share dialog). Ensure the hook checks that the file exists, logs failures, and replaces the old no-op share_file = None/interface.register_capabilities code so Kolibri’s “Share” button works again.
  2. Replace importing kolibri.plugins.app.utils and instead call app_initialize_url() from kolibri.core.device.utils to construct initialization URL.
  3. All enable_plugin("kolibri.plugins.app") calls are removed.
  4. Any previous interface.register( ) blocks are deleted, the hook registrations in kolibri_plugin.py handle capability wiring automatically.
  5. Windows/Posix server managers rely solely on hook side effects (no manual registration).

Reference

  • Look into this PR.
  • Hooks implementation examples here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions