Skip to content

Commit defe6fe

Browse files
committed
Merge branch 'master' of github.com:GoodDollar/GoodDAPP
2 parents 31e9637 + 7b2a886 commit defe6fe

File tree

10 files changed

+61
-28
lines changed

10 files changed

+61
-28
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7-
#### [v2.52.1-0](https://github.com/GoodDollar/GoodDAPP/compare/v2.52.6...v2.52.1-0)
7+
#### [v2.53.0](https://github.com/GoodDollar/GoodDAPP/compare/v2.52.6...v2.53.0)
88

9-
- fix: broken sdk-v2 package for android [`d4a22f4`](https://github.com/GoodDollar/GoodDAPP/commit/d4a22f4d21e44d7f2336465db1540c6935fc69d9)
10-
- add: goodid error tracking, bump gd sdks [`238b8ed`](https://github.com/GoodDollar/GoodDAPP/commit/238b8ed0951c300f6b8342eedf7de8d4df993cdd)
11-
- fixes: [`15b8e63`](https://github.com/GoodDollar/GoodDAPP/commit/15b8e63092540759a7f8918efd9d9d98d4d6a5ab)
9+
- chore: release qa version 2.52.1-0 [skip build] [`102b5a4`](https://github.com/GoodDollar/GoodDAPP/commit/102b5a4ae6b697f6a00b9d79f89272289c9439b8)
10+
- fix: goodid fixes, bump gd sdk"s [`b779dcc`](https://github.com/GoodDollar/GoodDAPP/commit/b779dcc76439b6874da57ee449902a63aa67ea07)
11+
- fix for onboard flow, styling fixes. bump gd sdk's [`1fb2312`](https://github.com/GoodDollar/GoodDAPP/commit/1fb23127e18ce61d2305028f6acdc6b901ca3a52)
1212

1313
#### [v2.52.6](https://github.com/GoodDollar/GoodDAPP/compare/v2.52.5...v2.52.6)
1414

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "@gooddollar/gooddapp",
3-
"version": "2.52.1-0",
3+
"version": "2.53.0",
44
"engines": {
55
"node": "18.x",
66
"npm": "9.x"
77
},
88
"scripts": {
99
"web": "npm run lingui:compile && NODE_OPTIONS=\"--openssl-legacy-provider\" vite",
10+
"goodid": "export REACT_APP_INDEXJS='./src/index.fv.jsx' && NODE_OPTIONS=\"--openssl-legacy-provider\" vite",
1011
"android": "npm run lingui:compile && ENVFILE=.env; npm run copy:gdfont && npm run animation:assets && NODE_OPTIONS=\"--openssl-legacy-provider\" react-native run-android",
1112
"ios": "npm run lingui:compile && ENVFILE=.env; npm run animation:assets && NODE_OPTIONS=\"--openssl-legacy-provider\" react-native run-ios",
1213
"start:native": "react-native start",
@@ -145,6 +146,7 @@
145146
"lottie-ios": "^3.4.0",
146147
"lottie-react-native": "^5",
147148
"lottie-web": "^5.12.2",
149+
"lz-string": "^1.5.0",
148150
"mnid": "^0.1.3",
149151
"mobile-device-detect": "^0.4.3",
150152
"moment": "^2.29.4",

src/components/faceVerification/screens/VerificationScreen.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ const FaceVerification = ({ screenProps, navigation }) => {
4040
const userStorage = useUserStorage()
4141
const { account, isFVFlow } = useContext(FVFlowContext)
4242
const payload = useFlagWithPayload('uat-goodid-flow')
43-
const { countries, whitelist } = payload ?? {}
44-
const [isEligible] = usePromise(() => supportedCountries(countries, whitelist, account))
43+
const { enabled = false, countries = '', whitelist = [] } = payload ?? {}
44+
const [isEligible] = usePromise(
45+
() => supportedCountries(countries, whitelist, account, enabled),
46+
[countries, whitelist, account, enabled],
47+
)
4548

4649
const { faceIdentifier: enrollmentIdentifier, chainId, v1FaceIdentifier: fvSigner } = useEnrollmentIdentifier()
4750

src/components/faceVerification/standalone/context/FVFlowContext.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22
import React, { createContext, useEffect, useRef } from 'react'
3-
3+
import { decompressFromEncodedURIComponent } from 'lz-string'
44
import useFVFlow from '../hooks/useFVFlow'
55
import DeepLinking from '../../../../lib/utils/deepLinking'
66

@@ -28,6 +28,10 @@ export const FVFlowContext = createContext({
2828
const FVFlowProvider = props => {
2929
const unsupportedCopyUrl = DeepLinking.link
3030

31+
const params = useRef(DeepLinking.params).current
32+
33+
// new version compresses params to support large signatures
34+
const decompressed = JSON.parse(decompressFromEncodedURIComponent(params.lz) || '{}')
3135
const {
3236
sig,
3337
nonce,
@@ -38,7 +42,8 @@ const FVFlowProvider = props => {
3842
account,
3943
chain,
4044
isDelta,
41-
} = useRef(DeepLinking.params).current
45+
} = { ...params, ...decompressed }
46+
4247
const { jwt, error } = useFVFlow(sig, nonce, faceIdentifier, account)
4348

4449
useEffect(() => {

src/config/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ const Config = {
231231
graphQlUrl: env.REACT_APP_GRAPHQL_URL || 'https://api.thegraph.com/subgraphs/name/gooddollar',
232232
chainIdUrl: env.REACT_APP_CHAINID_URL || 'https://chainid.network',
233233
networkId,
234-
isFVFlow: env.REACT_APP_BUILD_TARGET === 'FV',
235234
estimateGasPrice: env.REACT_APP_ESTIMATE_GAS_PRICE === 'true',
236235
defaultGasPrice: parseInt(env.REACT_APP_DEFAULT_GAS_PRICE || 11),
237236
defaultTxGas: parseInt(env.REACT_APP_DEFAULT_TX_GAS || 1000000),

src/lib/utils/supportedCountries.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { retry } from './async'
22

3-
export const supportedCountries = async (supportedCountries = '', whitelist = [], account) => {
3+
export const supportedCountries = async (supportedCountries = '', whitelist = [], account, enabled) => {
4+
if (enabled || whitelist?.includes(account)) {
5+
return true
6+
}
7+
if (!supportedCountries) {
8+
return false
9+
}
410
const country = await retry(async () => (await fetch('https://get.geojs.io/v1/ip/country.json')).json(), 3, 2000)
511
.then(data => data.country)
612
.catch(() => false)
713

8-
const isEligible = supportedCountries?.split(',')?.includes(country) || whitelist?.includes(account)
9-
10-
return isEligible
14+
return supportedCountries?.split(',')?.includes(country)
1115
}

src/lib/wallet/GoodWalletProvider.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ export const GoodWalletProvider = ({ children, disableLoginAndWatch = false }) =
9797
const [hasGoodIdEnabled, setHasGoodIdEnabled] = useState(false)
9898
const [shouldLoginAndWatch] = usePropsRefs([disableLoginAndWatch === false])
9999
const posthog = usePostHog()
100-
const { countries, whitelist } = useFlagWithPayload('uat-goodid-flow') ?? {}
100+
const { enabled = false, countries = '', whitelist = [] } = useFlagWithPayload('uat-goodid-flow') ?? {}
101101
const [isEligible] = usePromise(
102-
() => supportedCountries(countries, whitelist, goodWallet?.account),
103-
[countries, whitelist, goodWallet?.account],
102+
() => supportedCountries(countries, whitelist, goodWallet?.account, enabled),
103+
[countries, whitelist, goodWallet?.account, enabled],
104104
)
105105

106106
const db = getDB()

src/lib/wallet/MultipleHttpProvider.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,24 @@ export class MultipleHttpProvider extends HttpProvider {
5353
log.trace('Sending request to peer', { payload })
5454
return await this._sendRequest(payload)
5555
} catch (exception) {
56+
const error = exception?.error ? JSON.stringify(exception?.error) : exception?.message
57+
const notTxError = !isTxError(error)
58+
5659
// log error to analytics if last peer failed, ie all rpcs failed
57-
if (!isTxError(exception?.message) && !loggedProviders.has(provider) && peers[peers.length - 1] === item) {
60+
if (notTxError && !loggedProviders.has(provider) && peers[peers.length - 1] === item) {
5861
loggedProviders.set(provider, true)
5962

6063
const { message: originalMessage } = exception
6164
const errorMessage = 'Failed all RPCs' // so in analytics all errors are grouped under same message
6265

6366
// log.exception bypass network error filtering
64-
log.exception('MultiHttpProvider:', errorMessage, exception, { provider, originalMessage })
67+
log.exception('MultiHttpProvider:', errorMessage, exception, { error, provider, originalMessage })
6568
} else if (isRateLimitError(exception)) {
6669
log.warn('MultiHttpProvider rate limit error', exception.message, exception, { provider })
6770
endpoints.splice(endpoints.indexOf(item, 1))
6871
setTimeout(() => endpoints.push(item), 60000)
69-
} else {
70-
log.warn('MultiHttpProvider failed to send:', exception.message, exception, { provider })
72+
} else if (notTxError) {
73+
log.warn('MultiHttpProvider failed to send:', exception.message, exception, { error, provider })
7174
}
7275

7376
throw exception
@@ -86,17 +89,24 @@ export class MultipleHttpProvider extends HttpProvider {
8689
}
8790

8891
// if not connection issue - stop fallback, throw error
89-
const onFallback = error => {
90-
const { message, code } = error
91-
92-
const txError = isTxError(message)
92+
const onFallback = exception => {
93+
const { message, code, error } = exception
94+
const errorMessage = error ? JSON.stringify(error) : message
95+
const txError = isTxError(errorMessage)
9396
const conError = isConnectionError(message)
9497

9598
// retry if not tx issue and network error or if rpc responded with error (error.error)
96-
const willFallback = !txError && !!(code || error.error || !message || conError)
99+
const willFallback = !txError && !!(code || error || !message || conError)
97100

98101
if (!willFallback) {
99-
log.warn('send: got error without fallback', { message, error, willFallback, txError, conError })
102+
log.warn('send: got error without fallback', {
103+
message,
104+
exception,
105+
errorMessage,
106+
willFallback,
107+
txError,
108+
conError,
109+
})
100110
}
101111

102112
return willFallback

vercel-goodid-ignore-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# this is for vercel to prevent builds of feature branches. it is used in settings/git/ignored build step
44
echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF"
55

6-
if [[ "$VERCEL_GIT_COMMIT_REF" == "goodid/dev" || "$VERCEL_GIT_COMMIT_REF" == "goodid/qa" || "$VERCEL_GIT_COMMIT_REF" == "goodid/prod" ]] ; then
6+
if [[ "$VERCEL_GIT_COMMIT_REF" == "master" || "$VERCEL_GIT_COMMIT_REF" == "staging" || "$VERCEL_GIT_COMMIT_REF" == "goodid/dev" || "$VERCEL_GIT_COMMIT_REF" == "goodid/qa" || "$VERCEL_GIT_COMMIT_REF" == "goodid/prod" ]] ; then
77
# Proceed with the build
88
echo "✅ - Build can proceed"
99
exit 1;

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6880,6 +6880,7 @@ __metadata:
68806880
lottie-ios: ^3.4.0
68816881
lottie-react-native: ^5
68826882
lottie-web: ^5.12.2
6883+
lz-string: ^1.5.0
68836884
metro: 0.80.5
68846885
metro-core: ^0.80.5
68856886
metro-react-native-babel-preset: ^0.77.0
@@ -35458,6 +35459,15 @@ __metadata:
3545835459
languageName: node
3545935460
linkType: hard
3546035461

35462+
"lz-string@npm:^1.5.0":
35463+
version: 1.5.0
35464+
resolution: "lz-string@npm:1.5.0"
35465+
bin:
35466+
lz-string: bin/bin.js
35467+
checksum: 1ee98b4580246fd90dd54da6e346fb1caefcf05f677c686d9af237a157fdea3fd7c83a4bc58f858cd5b10a34d27afe0fdcbd0505a47e0590726a873dc8b8f65d
35468+
languageName: node
35469+
linkType: hard
35470+
3546135471
"magic-string@npm:0.27.0":
3546235472
version: 0.27.0
3546335473
resolution: "magic-string@npm:0.27.0"

0 commit comments

Comments
 (0)