Skip to content

Conversation

@heiytor
Copy link
Contributor

@heiytor heiytor commented Jun 17, 2025

Refactor AuthDevice method to separate device creation from updates and remove struct intermediaries in cache operations. This improves code clarity and maintainability while preserving all existing functionality.

  • Replace upsert-based DeviceCreate with explicit create/update flow
  • Remove intermediate Device struct from cache operations using map[string]string
  • Move hostname derivation logic to service layer for better separation
  • Add explicit device status updates for existing devices going online
  • Improve error handling and add proper logging for cache operations
  • Update documentation to be concise and focused on core functionality

DeviceCreate no longer returns insertion boolean, now focuses solely on creation with separate DeviceUpdate for modifications.

@heiytor heiytor self-assigned this Jun 17, 2025
@heiytor heiytor requested a review from a team as a code owner June 17, 2025 21:47
@heiytor heiytor force-pushed the refactor/api/device-auth branch from f83508b to 212a26e Compare June 17, 2025 21:51
otavio
otavio previously approved these changes Jun 17, 2025
Refactor AuthDevice method to separate device creation from updates and
remove struct intermediaries in cache operations. This improves code
clarity and maintainability while preserving all existing functionality.

- Replace upsert-based DeviceCreate with explicit create/update flow
- Remove intermediate Device struct from cache operations using
  map[string]string
- Move hostname derivation logic to service layer for better separation
- Add explicit device status updates for existing devices going online
- Improve error handling and add proper logging for cache operations
- Update documentation to be concise and focused on core functionality

DeviceCreate no longer returns insertion boolean, now focuses solely on
creation with separate DeviceUpdate for modifications.
@heiytor heiytor force-pushed the refactor/api/device-auth branch from a64918b to f1416fd Compare June 18, 2025 19:18
@otavio otavio merged commit d61e48a into master Jun 20, 2025
8 checks passed
@otavio otavio deleted the refactor/api/device-auth branch June 20, 2025 18:05
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.

4 participants