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
- Set
THINGSDB to an exact main.sqlite path.
- Import
things while access to or enumeration of the default Group Containers path is delayed.
- 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.
Problem
things.databaseresolvesDEFAULT_FILEPATHby globbing the Things App Group container at import time. This happens beforeDatabasechecks theTHINGSDBenvironment variable.On systems where enumerating that App Group container stalls or is slow, importing
thingscan therefore hang even though the caller supplied an exact, validTHINGSDBpath.Expected behavior
When
THINGSDBis set, use that explicit path before attempting automatic directory discovery.Reproduction
THINGSDBto an exactmain.sqlitepath.thingswhile access to or enumeration of the default Group Containers path is delayed.glob.iglob(...)instead of usingTHINGSDB.Proposed fix
Resolve the environment override first and only call
glob.iglobwhen no override is configured. Add regression tests proving discovery is bypassed whenTHINGSDBis set.