-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Create a token manager library for MapBox #23511
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
Conversation
|
@thesahindia Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@0xmiroslav @ One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/libs/actions/MapboxTokens.js
Outdated
|
|
||
| const hasTokenExpired = () => { | ||
| const now = moment(); | ||
| const expiration = moment(currentToken.expiration); |
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.
It will most likely not happen but there might be case when AppState change callback is called before Onyx connect callback, which will cause crash because of undefined currentToken.
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.
Ah yes, you're right. I'll add a check for that.
Updated!
|
Is |
|
It's been merged to |
|
After logout and login again, token isn't refreshed anymore until app reload Screen.Recording.2023-08-05.at.5.40.34.AM.mov |
|
Actually, I think that bug might be fine since we're calling |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - ChromeMobile Web - SafariDesktopiOSios.movAndroid |
situchan
left a comment
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.
![]()
Co-authored-by: Carlos Martins <cmartins@expensify.com>
Co-authored-by: Situ Chandra Shil <108292595+situchan@users.noreply.github.com>
|
@tgolen lint failing |
|
@arosiclair Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.3.51-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.3.52-0 🚀
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.3.52-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.52-5 🚀
|
Details
This library will manage the token for MapBox to ensure that an active token is always used with the MapBox library.
Fixed Issues
$ #22701
Tests
Note: this library isn't connected to anything now, but it can be tested by modifying a little bit of code. It will be fully tested in later PRs.
src/App.jstoimport MapboxTokens from './libs/actions/MapboxToken';and addMapboxTokens();to the top of theApp()function.src/lib/actions/MapboxTokens.jsand change therefreshIntervalto1000 * 10(so it will refresh every 10 seconds)Offline tests
QA Steps
No QA. This functionality is not connected to anything yet and it will be QAed in a future PR
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionNOTE: I only tested on web since the only thing being tested are some JS console logs
NOTE: I only tested on web since the only thing being tested are some JS console logs
toggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
NOTE: I only tested on web since the only thing being tested are some JS console logs
Web
Mobile Web - Chrome
NA
Mobile Web - Safari
NA
Desktop
NA
iOS
NA
Android
NA