Skip to content

fix(wallpapers-ocs): choices() must fetch its own index - #4

Open
perlowja wants to merge 2 commits into
singularityos-lab:mainfrom
perlowja:fix/ocs-choices-self-fetch
Open

perlowja wants to merge 2 commits into
singularityos-lab:mainfrom
perlowja:fix/ocs-choices-self-fetch

Conversation

@perlowja

Copy link
Copy Markdown

Summary

The plugin-based wallpaper manager refactor (132efb7 in singularity-shell)
made the browser provider-generic and now always calls choices("") --
the old OCS-specific static index-file load in the shell's browser page
was removed as part of making that page provider-agnostic. WallpaperOcs.categories()
then fails to parse the empty string as JSON:

Could not load OCS Network choices: Expected a JSON object

Confirmed live on real hardware (Dell Inspiron 5521, current desktop build).

wallpapers-bing's choices() already fetches its own data from the helper
(command({helper, "markets"}, ...)) rather than relying on the passed-in
index; this brings wallpapers-ocs in line with that same pattern by
fetching the index from the helper's own index subcommand.

Test plan

  • Real build: meson setup + ninja wallpapers-ocs/libwallpapers-ocs.so
    against current main + this fix, compiled clean (only pre-existing
    unrelated warnings).
  • Live smoke test on a running desktop (mine is mid-way through
    unrelated work tonight; will confirm once available).

AI assistance: disclosed

The plugin-based wallpaper manager refactor made the browser
provider-generic and always passes an empty index string to
choices(); WallpaperOcs.categories() then fails to parse "" as JSON
("Expected a JSON object"), confirmed live on real hardware. Fetch the
index from the helper directly, same pattern wallpapers-bing already
uses for its own choices().

Assisted-by: Claude Code:claude-sonnet-5
AI-Scope: Root-caused and fixed choices() against the empty index string the refactored browser now always passes.
Two real bugs confirmed live on real hardware:

1. The plugin-based browser always passes an empty index string to
   choices() (the shell no longer stages a per-provider index file).
   WallpaperOcs.categories("") throws "Expected a JSON object". Fetch
   the index from the helper directly, matching wallpapers-bing's own
   choices() pattern.

2. WallpaperOcs.items() sets item.owner_id to the per-network name
   (e.g. "pling"), but the registered provider id is the "ocs"
   aggregate. import_card()'s provider_registry.lookup(item.owner_id)
   then fails "Wallpaper provider is not active" for every OCS import.

Assisted-by: Claude Code:claude-sonnet-5
AI-Scope: Root-caused and fixed both against a live desktop session; real amd64 build verified clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant