-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add debug menu to specify endpoint for mobile token server #5049
base: master
Are you sure you want to change the base?
Conversation
|
||
const saveDebugIpAddress = async (ipAddress: string) => { | ||
if (ipAddress.length > 0) { | ||
const fullAddress = `http://${ipAddress}:8080`; |
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.
Not quite sure what's useful to test in practice, but should we have the input be the whole address instead of just the IP? If it's useful to e.g. for point a prod device to staging servers, where we don't have access to a server running on a local IP.
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.
We usually save that into the .env file and read from it.
NOTE: But I see there is a menu so, I agree then that should be full address here
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.
We can change it to a whole IP (probably with a http://
prefix added) 👍🏼
Also, pointing a prod device to staging server won't work, because the tokens on Prod are different from tokens from Staging.
This is just to make it easier for testing on staging, either for reproducing a bug, or testing/developing new functionality. For example: we want to replicate a bug with creating tokens, we can just point the token server to local, instead of changing some parameters from the code to allow debug. These changes might be minor, but the added overhead of having to modify the server is something that we could have avoided with this menu.
@@ -0,0 +1,58 @@ | |||
import {Button} from '@atb/components/button'; | |||
import {ThemeText} from '@atb/components/text'; | |||
import {storage} from '@atb/storage'; |
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.
Regarding storage, we recently created usePersistedBoolState
.
We might want to either create one for string as well, or make the existing one general purpose. @gorandalum
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.
Yeah, it is possible to refactor it into a more generic usePersistedState
.
closes https://github.com/AtB-AS/kundevendt/issues/20084
Pretty much self-explanatory, adds debug menu for specifying the mobile token server endpoint.
If there's a better alternative than using the
storage
function I would love to know more about it 😄mobile.token.debug.webm