Skip to content

THINGSDB is ignored during import-time database discovery #149

Description

@fazmulla66-bot

Problem

things.database resolves DEFAULT_FILEPATH by globbing the Things App Group container at import time. This happens before Database checks the THINGSDB environment variable.

On systems where enumerating that App Group container stalls or is slow, importing things can therefore hang even though the caller supplied an exact, valid THINGSDB path.

Expected behavior

When THINGSDB is set, use that explicit path before attempting automatic directory discovery.

Reproduction

  1. Set THINGSDB to an exact main.sqlite path.
  2. Import things while access to or enumeration of the default Group Containers path is delayed.
  3. The import still enters glob.iglob(...) instead of using THINGSDB.

Proposed fix

Resolve the environment override first and only call glob.iglob when no override is configured. Add regression tests proving discovery is bypassed when THINGSDB is set.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions