-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Create a token manager library for MapBox #23511
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 |
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 <[email protected]>
Co-authored-by: Situ Chandra Shil <[email protected]>
@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.js
toimport MapboxTokens from './libs/actions/MapboxToken';
and addMapboxTokens();
to the top of theApp()
function.src/lib/actions/MapboxTokens.js
and change therefreshInterval
to1000 * 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectionNOTE: 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
toggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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