Skip to content

Decouple environment access from unrelated service initialization #52

Description

@cyberphantom52

Problem

Bottles::open() loads profiles, initializes HTTP and download services, loads cached catalogs and acquired addons, connects to FVS, and loads Library plugins before returning.

A failure in any of these prevents access to the entire core. For example, a broken Library plugin or unreadable catalog cache prevents inspecting existing native Bottles.

Context reinforces this coupling by requiring these services to be initialized together.

Proposed change

Give the existing services independent initialization boundaries:

  • Open Bottle and Program collections without requiring profiles, catalogs, or loaded plugins.
  • Load profiles and addon state when opening their respective services.
  • Resolve plugin runtimes through the host when invoking their capabilities, as proposed in the Library ownership issue.
  • Connect to FVS when an operation first requires it, then reuse the connection.

Keep Bottles::open() as a convenience for assembling the application, but allow callers to open individual managers without initializing unrelated services.

Reduce Context dependencies accordingly. Keep this within the existing crate and reuse the existing managers.

FVS behavior

Lazy initialization must not weaken transactional edits. In an FVS-enabled build, an edit requiring a snapshot must obtain FVS successfully before mutating the environment.

Builds without FVS retain their existing behavior without rollback guarantees.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions