Skip to content

fix: plugin store findings before 0.19.0 #564

Closed

Description

@uniqueg

Mixed bag of low findings from the pre-release review of 0.19.0 (plugin store, #557, #560), to fix before the release:

  • Store DB with access control and no db section: register_access_control adds the policy database to db.dbs when the app has no db section, and the plugin store then takes it as the app's first database: plugin entries land next to the Casbin policies and the listing says storage: shared, while the docs say "without database, each process keeps its entries in memory". The store must only use the app's own databases (memory/local mode otherwise); regression test.
  • Memory store is unbounded: document that entries in memory have no size limit (no namespace limit in v1), recommend a short max_ttl without a database, and log a warning once at startup when a plugin that declares stored data uses the store without a database (per process; per-process budgets with several workers).
  • max_ttl applies only on writes: lowering max_ttl leaves existing entries readable until their original expiry. Cap reads at the current max_ttl; document retention and a cleanup for lowered max_ttl and turned-off stores.
  • Docs: per-user budget example raises ValueError for anonymous callers (subject is None); handle it.
  • Docs: get(key, default) with stored null returns None, not default; reword the docs (keep the behaviour).
  • Listing spec version: the listing gained required fields (data_stored, storage) but info.version is still 1.0.0; bump it and document that plugins using ctx.store or data_stored need foca>=0.19.
  • Permanent index errors: log OperationFailure codes 85, 86 and 13 (index options/key conflicts, unauthorized) at startup at error level with the cause, instead of a warning.

Not in scope: key_for() unkeyed SHA-256 vs. a keyed hash (needs a maintainer decision).

Activity

  1. added this to the v0.19.0 milestone on Oct 31, 2026
  2. added
    priority: high
    status: in progress
    type: bug
    workload: hours
    on Oct 31, 2026
  3. removed
    status: in progress
    on Oct 31, 2026
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

    priority: hightype: bugworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions