Skip to content

Commit

Permalink
fix(sign): Prevent runtime error on failed sign tx
Browse files Browse the repository at this point in the history
When a user has 2FA enabled and gets rate limited by Twilio
the sign request fails with no successful transactions, making
`successHashes` `undefined`. This PR defaults `successHashes` to an
empty array to prevent some of the down stream logic which assume it
exists from failing.
  • Loading branch information
morgsmccauley committed Mar 30, 2022
1 parent 042467b commit 0663f7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/frontend/src/redux/reducers/sign/index.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@ import { parseTransactionsToSign, makeAccountActive } from '../../actions/accoun
import { calculateGasLimit, increaseGasForFirstTransaction, handleSignTransactions, SIGN_STATUS, removeSuccessTransactions, updateSuccessHashes, checkAbleToIncreaseGas, getFirstTransactionWithFunctionCallAction, calculateGasForSuccessTransactions } from '../../slices/sign';

const initialState = {
status: SIGN_STATUS.NEEDS_CONFIRMATION
status: SIGN_STATUS.NEEDS_CONFIRMATION,
successHashes: []
};

const deserializeTransactionsFromString = (transactionsString) => transactionsString.split(',')
@@ -20,6 +21,7 @@ const sign = handleActions({
const allActions = transactions.flatMap((t) => t.actions);

return {
...initialState,
status: SIGN_STATUS.NEEDS_CONFIRMATION,
callbackUrl,
meta,

0 comments on commit 0663f7a

Please sign in to comment.