fix: rebase onto main, fix SQLite concurrency, lint clean
All checks were successful
check / check (push) Successful in 2m11s

- Add busy_timeout PRAGMA and MaxOpenConns(1) for SQLite stability
- Use per-test temp DB in handler tests to prevent state leaks
- Pre-allocate migrations slice (prealloc lint)
- Remove invalid linter names (wsl_v5, noinlineerr) from .golangci.yml
- Remove unused //nolint:gosec directives
- Replace context.Background() with t.Context() in tests
- Use goimports formatting for all files
- All make check passes with zero failures
This commit is contained in:
clawbot
2026-02-26 20:25:46 -08:00
parent 6043e9b879
commit 69e1042e6e
8 changed files with 88 additions and 48 deletions

View File

@@ -15,8 +15,8 @@ import (
)
const (
httpTimeout = 30 * time.Second
pollExtraTime = 5
httpTimeout = 30 * time.Second
pollExtraTime = 5
httpErrThreshold = 400
)
@@ -125,7 +125,7 @@ func (c *Client) PollMessages(
req.Header.Set("Authorization", "Bearer "+c.Token)
resp, err := client.Do(req) //nolint:gosec // URL built from trusted BaseURL + hardcoded path
resp, err := client.Do(req)
if err != nil {
return nil, err
}
@@ -272,7 +272,7 @@ func (c *Client) do(
)
}
resp, err := c.HTTPClient.Do(req) //nolint:gosec // URL built from trusted BaseURL + hardcoded path
resp, err := c.HTTPClient.Do(req)
if err != nil {
return nil, fmt.Errorf("http: %w", err)
}

View File

@@ -24,9 +24,9 @@ type StateResponse struct {
// Message represents a chat message envelope.
type Message struct {
Command string `json:"command"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Command string `json:"command"`
From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
Params []string `json:"params,omitempty"`
Body any `json:"body,omitempty"`
ID string `json:"id,omitempty"`

View File

@@ -12,10 +12,10 @@ import (
)
const (
splitParts = 2
pollTimeout = 15
pollRetry = 2 * time.Second
timeFormat = "15:04"
splitParts = 2
pollTimeout = 15
pollRetry = 2 * time.Second
timeFormat = "15:04"
)
// App holds the application state.