Skip to content

Feature/golang v0.2.6#4

Merged
johnwmail merged 5 commits intogolangfrom
feature/golang-v0.2.6
Apr 24, 2026
Merged

Feature/golang v0.2.6#4
johnwmail merged 5 commits intogolangfrom
feature/golang-v0.2.6

Conversation

@johnwmail
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and changes across the codebase, primarily focused on note ID generation, validation logic, and improved robustness for note handling. The most significant updates are the new word-based note ID scheme, stricter validation, enhanced auto-save logic in the frontend, and corresponding updates to tests and workflows.

Note ID Generation and Validation

  • Replaced the old random alphanumeric note ID generator with a new scheme that generates IDs using a random word from a curated list (3-5 letters, uppercase) followed by two random digits (from 2-9), making IDs more user-friendly and less error-prone. The validation logic now enforces uppercase letters (excluding ambiguous ones like I, O, 1, 0) and a length of 3-32 characters. (utils.go, utils_test.go) [1] [2]
  • Updated all tests and usages to use the new note ID format (e.g., replacing "test123" with "TEST23") and added/adjusted test cases to reflect the stricter validation and new ID structure. (handlers_test.go, storage_test.go, utils_test.go) [1] [2] [3]

Backend Logic and Robustness

  • Improved parsing of note requests to ensure that when a raw body is sent with a Content-Type: application/x-www-form-urlencoded (as with curl --data-binary), the note ID is still correctly extracted from the path. Added a test to verify this behavior. (handlers.go, handlers_test.go) [1] [2]

Frontend Auto-save Improvements

  • Enhanced the auto-save logic in the frontend to prevent concurrent saves by introducing a saving flag, ensuring that a new save is not started until the previous one completes. This prevents race conditions and potential data loss. (handlers.go) [1] [2] [3]

CI/CD Workflow Adjustments

  • Updated GitHub Actions workflows to trigger on the golang branch instead of main or dev, reflecting a shift in the primary development branch for both deployment and testing. (.github/workflows/deploy-lambda.yml, .github/workflows/test.yml) [1] [2]

These changes collectively improve the reliability, usability, and maintainability of the note-taking service, especially around note identification and storage.

@johnwmail johnwmail merged commit 3f0af63 into golang Apr 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant