-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
kobotoolbox: switch baseURL to baseUrl #989
Conversation
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
packages/kobotoolbox/src/Utils.js
Outdated
|
||
let baseURL = baseUrl || state.configuration.baseURL; | ||
|
||
if (!baseUrl) { |
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.
This won't work because if baseURL is set, the baseUrl var will have a value and this block won't be entered. Did you test it manually?
I think you should be more explicit and have a whole if statement around state.configuration.baseURL, and do the warning and assignment inside
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.
I did test it, but let me change
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.
Fixed
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
packages/kobotoolbox/src/Utils.js
Outdated
|
||
let baseURL; | ||
|
||
if (state.configuration.baseURL) { |
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.
Ok but this way, if baseURL and baseUrl are set, baseURL will win AND users will get an incorrect warning.
I find it kinda weird too that the code uses the wrong styling of baseURL
. It would feel cleaner if code and config were consistent and baseURL was the outlier.
So:
baseUrl
needs to be the main variable
`if (!baseURL && state.configuration.baseURL) { /* warn and assign */ }
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.
Please don't rush your solution! It is very expensive to keep revisiting little fixes like this
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.
I have updated it with baseUrl
as the main variable
Signed-off-by: Hunter Achieng <achienghunter@gmail.com>
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.
Thank you!
Summary
Switch from using
baseURL
tobaseUrl
inkobotoolbox
Fixes #985
Details
All adaptors use
baseUrl
as opposed tokobotoolbox
that usesbaseURL
. We have switched tobaseUrl
but still allow users to send requests withbaseURL
but log a warning.AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to
know!):
You can read more details in our
Responsible AI Policy
Review Checklist
Before merging, the reviewer should check the following items:
production? Is it safe to release?
dev only changes don't need a changeset.