Commit Graph

8 Commits

Author SHA1 Message Date
311e91d3ff test(01-02): add failing tests for oversized body (413) - RED
- TestWebhookHandler_OversizedBody: POST /webhook with >1MB body expects 413
- TestTagsHandler_OversizedBody: POST /api/tags with >1MB body expects 413
- TestTagAssignmentHandler_OversizedBody: PUT /api/tag-assignments with >1MB body expects 413
2026-03-23 21:18:39 +01:00
e2d388cfd4 test(01-01): add TestUpdateEvent_PreservesTagOnUpsert regression test
- Verifies tag survives a second UpdateEvent() for the same image (DATA-01)
- Verifies acknowledged_at is reset to NULL by the new event
- Verifies event fields (Status) are updated by the new event
2026-03-23 21:14:21 +01:00
7edbaad362 fix(01-01): replace INSERT OR REPLACE with UPSERT and enable FK enforcement
- Add PRAGMA foreign_keys = ON in InitDB() after SetMaxOpenConns(1)
- Replace INSERT OR REPLACE INTO updates with named-column INSERT ON CONFLICT UPSERT
- UPSERT preserves tag_assignments rows on re-insert (fixes DATA-01)
- FK enforcement makes ON DELETE CASCADE fire on tag deletion (fixes DATA-02)
2026-03-23 21:13:43 +01:00
c0746a7f02 **feat(webhook):** add WEBHOOK_SECRET for token authentication support
All checks were successful
CI / build-test (push) Successful in 1m28s
- Protect `/webhook` endpoint using the `Authorization` header
- Update `README.md` with setup instructions and examples for authentication
- Warn when `WEBHOOK_SECRET` is not configured
- Add tests for valid, missing, and invalid token scenarios
- Update `docker-compose.yml` to support `WEBHOOK_SECRET` configuration
2026-02-27 14:58:43 +01:00
1983a3bed9 - **fix(errors):** ensure proper error handling with errors.Is instead of direct comparison for http.ErrServerClosed
Some checks failed
CI / build-test (push) Successful in 1m4s
CI / docker (push) Failing after 2s
- **fix(sql):** wrap `rows.Close` in a `defer` function to safely handle potential close errors
- **fix(api):** handle JSON encoding errors in API responses to prevent unhandled edge cases
- **docs:** correct typos and improve phrasing in `.claude/CLAUDE.md`
- **test:** add error handling for `UpdateEvent` in test cases
2026-02-25 20:44:18 +01:00
6094edc5c8 - **refactor(main):** migrate static HTML to React components
Some checks failed
CI / build-test (push) Successful in 1m25s
CI / docker (push) Failing after 1s
- **feat(ui):** implement `AcknowledgeButton` component for acknowledging images
- **feat(stats):** add dashboard stats for total images, pending updates, and acknowledged status
- **chore(deps):** introduce `bun` dependency management and add required libraries
- **style(ui):** enhance UI with Tailwind-based components and modularity improvements
- **chore:** add drag-and-drop tag assignment using `@dnd-kit/core`
2026-02-25 20:37:15 +01:00
e4f32132e3 Refactor project structure: enhance tests, improve server shutdown, expand CI checks, and update UI for better event presentation.
Some checks failed
CI / build-test (push) Failing after 4s
CI / docker (push) Has been skipped
2026-02-23 21:12:39 +01:00
9432bf6758 Refactor project structure: modularized code into pkg and cmd directories, added unit tests, improved CI/CD pipeline, and enhanced documentation. 2026-02-23 17:17:01 +01:00