fix(nodb): set storeActive when initializing no-db mode
The `bd comment --no-db` command was failing because initializeNoDbMode() set the global `store` but never set `storeActive = true`. When comments.go called ensureStoreActive(), the guard check failed and it tried to find a SQLite database, returning an ironic error telling the user to use --no-db. Why only `comment` was affected: - Commands like `create`, `update`, `close` use `store` directly - The `comment` command calls `ensureStoreActive()` first as a safety check - That function guards on `storeActive && store != nil` - Since `storeActive` was never set, the guard failed and it looked for SQLite The fix aligns no-db mode with what ensureStoreActive() expects.
This commit is contained in:
@@ -72,8 +72,11 @@ func initializeNoDbMode() error {
|
||||
|
||||
debug.Logf("using prefix '%s'", prefix)
|
||||
|
||||
// Set global store
|
||||
// Set global store and mark as active (fixes bd comment --no-db)
|
||||
storeMutex.Lock()
|
||||
store = memStore
|
||||
storeActive = true
|
||||
storeMutex.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user