🚀 Release v1.18.7
This release focuses on code quality improvements, resource leak fixes, and comprehensive unit test coverage for critical API endpoints.
🔧 Code Quality
- Replaced magic numbers with HTTP status constants (
http.StatusOK,http.StatusBadRequest,http.StatusInternalServerError) across all API controllers for improved code readability and maintainability - Simplified code structure in
GET /v1/transactions/idswith early returns instead of nested if-else blocks - Optimized
GET /v1/itemsendpoint by replacingQuerywithQueryRowfor single-row transaction lookup, reducing database round-trips
🐛 Bug Fixes
- Fixed resource leak in
GET /v1/itemswheredefer rows.Close()was incorrectly placed after the loop instead of immediately after query success - Fixed resource leak in
GET /v1/items/idswith samedefer rows.Close()positioning issue - Fixed resource leak in
GET /v1/transactions/idswith samedefer rows.Close()positioning issue
✅ Testing
- Added comprehensive unit tests for
GET /v1/versionendpoint covering version formats, content-type, and closure behavior - Added comprehensive unit tests for
GET /v1/itemsandGET /v1/items/idsendpoints covering validation, empty results, and data retrieval scenarios - Added comprehensive unit tests for
GET /v1/transactions/idsendpoint covering JSON validation, filtering, and result ordering - Added comprehensive unit tests for
POST /v1/transactionsendpoint covering transaction creation, duplicate handling, and multi-item transactions
🐳 Docker Image
docker pull cr.rda.run/txlog/server:v1.18.7🔗 Links
- Full Changelog: v1.18.6...v1.18.7
- Documentation: https://github.com/txlog/server
- Issues: https://github.com/txlog/server/issues