Skip to content

Commit

Permalink
increase mobile app verification token TTL from 1 minute to 5 minutes (
Browse files Browse the repository at this point in the history
…#2859)

# What this PR does

Trying to connect a mobile app emulator, following the instructions
[here](https://github.com/grafana/oncall-mobile-app#getting-started), to
a cloud stack is incredibly difficult given the 1 minute token TTL. You
need to retrieve the token from the HTTP response in your browser's
inspect panel, plug that token into the `make run` command and cross
your fingers that the emulator starts up in < 45 seconds before the
token expires.

This PR increases the verification token TTL from 1 minute to 5 minutes.

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
  • Loading branch information
joeyorlando authored Aug 22, 2023
1 parent 5885d98 commit 7d377ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/containers/MobileAppConnection/MobileAppConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ type Props = {
};

const INTERVAL_MIN_THROTTLING = 500;
const INTERVAL_QUEUE_QR = process.env.MOBILE_APP_QR_INTERVAL_QUEUE
? parseInt(process.env.MOBILE_APP_QR_INTERVAL_QUEUE, 10)
: 50000;
/**
* 290_000 = 4 minutes and 50 seconds
* QR code token has a TTL of 5 minutes
* This means we will fetch a new token just before the current one expires
*/
const INTERVAL_QUEUE_QR = 290_000;
const INTERVAL_POLLING = 5000;
const BACKEND = 'MOBILE_APP';

Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ module.exports.getWebpackConfig = (config, options) => {
*/
new webpack.EnvironmentPlugin({
ONCALL_API_URL: null,
MOBILE_APP_QR_INTERVAL_QUEUE: null,
}),
new webpack.DefinePlugin({
'process.env': JSON.stringify(dotenv.config().parsed),
Expand Down

0 comments on commit 7d377ce

Please sign in to comment.