Skip to content

Align provider registries: typed errors + concurrent-connect dedupe in @bb/db and @bb/graph-db #125

Description

@bharatsachya

Type: architecture / consistency · Difficulty: medium

@bb/db (packages/db/src/index.ts) and @bb/graph-db (packages/graph-db/src/index.ts) implement the same provider-registry as @bb/queue (packages/queue/src/registry.ts) but more crudely: they throw new Error("… not initialized") instead of a typed @bb/errors class, and they lack the in-flight connecting promise that @bb/queue uses to dedupe concurrent connect callers.

Do: add DbNotConnectedError / GraphNotConnectedError to @bb/errors and throw those from getDb()/getGraph(); port the concurrent-connect dedupe from connectQueue to connectDb/connectGraph.

Done when: all three registries report not-connected via typed errors and guard against double-connect identically.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions