-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AS-3208 - error codes endpoints with tokenID #419
base: main
Are you sure you want to change the base?
AS-3208 - error codes endpoints with tokenID #419
Conversation
Ah the |
changed |
// @Failure 404 {object} helpers.ErrorRes "Vehicle not found" | ||
// @Security BearerAuth | ||
// @Router /user/vehicle/{tokenID}/error-codes [post] | ||
func (udc *UserDevicesController) QueryDeviceErrorCodesByTokenID(c *fiber.Ctx) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the same function as QueryDeviceErrorCodes other than the ud lookup? If so we can just use a function instead of duplicating the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are new ones using vehicle tokenID instead of legacy device ID, the old ones will be removed in future releases, we'll also drop the user_device_id
column from error_code_queries
table at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's mark those as deprecated then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added deprecation info
Proposed Changes
user_device_token_id
inerror_code_queries
(migration, model changes)/error-codes/*
endpoints usingtokenID
instead ofuserDeviceID
/clear
endpoint status codes aligned with the spec (404/429)Note
For now this new field is nullable, since we still may have some devices without a tokenID. Making it not-nullable also breaks other parts (e.g. old version, that we will remove in the future) and older unit tests.