Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
82b53ca
chore: return proper promises
DanielSchiavini Oct 31, 2025
74e5e71
chore: replace void by errorCallback
DanielSchiavini Oct 31, 2025
c5a9359
chore: replace void by errorCallback
DanielSchiavini Oct 31, 2025
ce960ce
refactor: simplify ternaries
DanielSchiavini Oct 31, 2025
b455988
refactor: async instead of return
DanielSchiavini Oct 31, 2025
c2ba6fa
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Oct 31, 2025
98fc09c
fix: `fetchInitial` type
DanielSchiavini Oct 31, 2025
fe83777
fix: typecheck
DanielSchiavini Nov 3, 2025
280039b
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Nov 3, 2025
ee158d1
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Nov 3, 2025
ca91a1d
chore: save artifacts
DanielSchiavini Nov 3, 2025
8637db8
fix: lint and component tests
DanielSchiavini Nov 3, 2025
2ae17ee
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Nov 3, 2025
a081869
chore: self-review
DanielSchiavini Nov 3, 2025
8741616
Merge branch 'fix/lti-disabled' of github.com:curvefi/curve-frontend …
DanielSchiavini Nov 3, 2025
404701d
chore: job name
DanielSchiavini Nov 3, 2025
66af2b0
Merge branch 'main' into chore/interval-await
DanielSchiavini Nov 3, 2025
519b712
Merge branch 'main' into chore/interval-await
DanielSchiavini Nov 4, 2025
eaa1221
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Nov 4, 2025
93e8c05
chore: only show async errors on preview urls for now
DanielSchiavini Nov 4, 2025
305c578
Merge branch 'main' into chore/interval-await
DanielSchiavini Nov 4, 2025
09ebb93
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Nov 5, 2025
d3606bb
Merge branch 'main' of github.com:curvefi/curve-frontend into chore/i…
DanielSchiavini Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ jobs:
ELECTRON_ENABLE_LOGGING: true # send console logs to stdout in electron browser
NODE_ENV: test

- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-component-${{ matrix.browser }}-${{ matrix.count }}
path: tests/cypress/screenshots
retention-days: 1
if-no-files-found: error

cypress-component-rpc:
name: Cypress component tests with RPC
if: github.ref_name == 'main'
Expand Down Expand Up @@ -88,6 +96,8 @@ jobs:
with:
name: cypress-rpc
path: tests/cypress/screenshots
retention-days: 1
if-no-files-found: error

cypress-e2e:
strategy:
Expand All @@ -98,7 +108,7 @@ jobs:
include:
- browser: chrome
count: 2
name: Cypress in ${{ matrix.browser }} ${{ matrix.count }}
name: Cypress e2e tests in ${{ matrix.browser }} ${{ matrix.count }}
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -134,7 +144,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-main-${{ matrix.browser }}-${{ matrix.count }}
name: cypress-e2e-${{ matrix.browser }}-${{ matrix.count }}
path: tests/cypress/screenshots
retention-days: 1
if-no-files-found: error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ErrorMessage from '@/dao/components/ErrorMessage'
import useStore from '@/dao/store/useStore'
import Spinner, { SpinnerWrapper } from '@ui/Spinner'
import { t } from '@ui-kit/lib/i18n'
import { errorFallback } from '@ui-kit/utils/error.util'

interface GaugeWeightHistoryChartProps {
gaugeAddress: string
Expand All @@ -21,7 +22,7 @@ const GaugeWeightHistoryChart = ({ gaugeAddress, minHeight }: GaugeWeightHistory

useEffect(() => {
if (!gaugeWeightHistoryMapper[gaugeAddress]) {
void getHistoricGaugeWeights(gaugeAddress)
getHistoricGaugeWeights(gaugeAddress).catch(errorFallback)
}
}, [gaugeAddress, gaugeWeightHistoryMapper, getHistoricGaugeWeights])

Expand All @@ -33,7 +34,7 @@ const GaugeWeightHistoryChart = ({ gaugeAddress, minHeight }: GaugeWeightHistory
message={t`Error fetching historical gauge weights data`}
onClick={(e?: MouseEvent) => {
e?.stopPropagation()
void getHistoricGaugeWeights(gaugeAddress)
getHistoricGaugeWeights(gaugeAddress).catch(errorFallback)
}}
/>
</ErrorWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ErrorMessage from '@/dao/components/ErrorMessage'
import useStore from '@/dao/store/useStore'
import Box from '@ui/Box'
import { t } from '@ui-kit/lib/i18n'
import { errorFallback } from '@ui-kit/utils/error.util'
import Spinner from '../../Spinner'
import PositiveAndNegativeBarChart from './PositiveAndNegativeBarChart'

Expand All @@ -17,7 +18,7 @@ const DailyLocks = () => {

useEffect(() => {
if (veCrvLocks.locks.length === 0 && veCrvLocks.fetchStatus !== 'ERROR') {
void getVeCrvLocks()
getVeCrvLocks().catch(errorFallback)
}
}, [getVeCrvLocks, veCrvLocks.locks.length, veCrvLocks.fetchStatus])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useStore from '@/dao/store/useStore'
import Box from '@ui/Box'
import { formatDate, formatNumber } from '@ui/utils'
import { t } from '@ui-kit/lib/i18n'
import { errorFallback } from '@ui-kit/utils/error.util'
import Spinner from '../../Spinner'
import VeCrvFeesChart from '../VeCrvFeesChart'

Expand All @@ -18,7 +19,7 @@ const VeCrcFees = () => {

useEffect(() => {
if (veCrvFees.fees.length === 0 && !feesError) {
void getVeCrvFees()
getVeCrvFees().catch(errorFallback)
}
}, [getVeCrvFees, veCrvFees, feesError])

Expand Down
3 changes: 2 additions & 1 deletion apps/main/src/dao/components/PageAnalytics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useStore from '@/dao/store/useStore'
import Box from '@ui/Box'
import { t } from '@ui-kit/lib/i18n'
import { TabsSwitcher, type TabOption } from '@ui-kit/shared/ui/TabsSwitcher'
import { errorFallback } from '@ui-kit/utils/error.util'
import CrvStats from './CrvStats'
import DailyLocks from './DailyLocksChart'
import HoldersTable from './HoldersTable'
Expand All @@ -24,7 +25,7 @@ const Analytics = () => {

useEffect(() => {
if (veCrvHolders.topHolders.length === 0 && veCrvHolders.fetchStatus !== 'ERROR') {
void getVeCrvHolders()
getVeCrvHolders().catch(errorFallback)
}
}, [getVeCrvHolders, veCrvHolders.topHolders.length, veCrvHolders.fetchStatus])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { formatLocaleDate } from '@ui/utils/'
import { t } from '@ui-kit/lib/i18n'
import { DAO_ROUTES } from '@ui-kit/shared/routes'
import { shortenAddress } from '@ui-kit/utils'
import { errorFallback } from '@ui-kit/utils/error.util'
import { GAUGE_VOTES_TABLE_LABELS } from './constants'

interface GaugeVotesTableProps {
Expand Down Expand Up @@ -40,7 +41,7 @@ const GaugeVotesTable = ({ gaugeAddress, tableMinWidth }: GaugeVotesTableProps)
// Get user proposal votes
useEffect(() => {
if (!gaugeVotesMapper[gaugeAddress] && gaugeVotesLoading && !gaugeVotesError) {
void getGaugeVotes(gaugeAddress)
getGaugeVotes(gaugeAddress).catch(errorFallback)
}
}, [getGaugeVotes, gaugeAddress, gaugeVotesLoading, gaugeVotesError, gaugeVotesMapper])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Spinner, { SpinnerWrapper } from '@ui/Spinner'
import { t } from '@ui-kit/lib/i18n'
import { DAO_ROUTES } from '@ui-kit/shared/routes'
import { formatNumber } from '@ui-kit/utils'
import { errorFallback } from '@ui-kit/utils/error.util'
import VoteGaugeField from '../GaugeVoting/VoteGaugeField'
import GaugeDetailsSm from './GaugeDetailsSm'
import TitleComp from './TitleComp'
Expand Down Expand Up @@ -45,7 +46,7 @@ const SmallScreenCard = ({

useEffect(() => {
if (open && !gaugeWeightHistoryMapper[gaugeData.address]) {
void getHistoricGaugeWeights(gaugeData.address)
getHistoricGaugeWeights(gaugeData.address).catch(errorFallback)
}
}, [gaugeData.address, gaugeWeightHistoryMapper, getHistoricGaugeWeights, open])

Expand Down Expand Up @@ -115,7 +116,7 @@ const SmallScreenCard = ({
message={t`Error fetching historical gauge weights data`}
onClick={(e?: MouseEvent) => {
e?.stopPropagation()
void getHistoricGaugeWeights(gaugeData.address)
getHistoricGaugeWeights(gaugeData.address).catch(errorFallback)
}}
/>
</ErrorWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import IconButton from '@ui/IconButton'
import Spinner, { SpinnerWrapper } from '@ui/Spinner'
import { t } from '@ui-kit/lib/i18n'
import { DAO_ROUTES } from '@ui-kit/shared/routes'
import { errorFallback } from '@ui-kit/utils/error.util'
import { Chain } from '@ui-kit/utils/network'

type Props = {
Expand Down Expand Up @@ -69,7 +70,7 @@ const GaugeListItem = ({

useEffect(() => {
if (open && !gaugeWeightHistoryMapper[gaugeData.address]) {
void getHistoricGaugeWeights(gaugeData.address)
getHistoricGaugeWeights(gaugeData.address).catch(errorFallback)
}
}, [gaugeData.address, gaugeWeightHistoryMapper, getHistoricGaugeWeights, open])

Expand Down Expand Up @@ -113,7 +114,7 @@ const GaugeListItem = ({
message={t`Error fetching historical gauge weights data`}
onClick={(e?: MouseEvent) => {
e?.stopPropagation()
void getHistoricGaugeWeights(gaugeData.address)
getHistoricGaugeWeights(gaugeData.address).catch(errorFallback)
}}
/>
</ErrorWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Button from '@ui/Button'
import TooltipIcon from '@ui/Tooltip/TooltipIcon'
import { convertToLocaleTimestamp, formatDate, formatNumber } from '@ui/utils'
import { t } from '@ui-kit/lib/i18n'
import { errorFallback } from '@ui-kit/utils/error.util'
import { Chain } from '@ui-kit/utils/network'
import NumberField from './NumberField'

Expand Down Expand Up @@ -49,7 +50,7 @@ const VoteGaugeField = ({ powerUsed, userGaugeVoteData, userVeCrv, newVote = fal

const handleCastVote = () => {
if (!address) return
void castVote(address, gaugeAddress, power)
castVote(address, gaugeAddress, power).catch(errorFallback)
}

return (
Expand Down
3 changes: 2 additions & 1 deletion apps/main/src/dao/components/PageProposal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useWallet } from '@ui-kit/features/connect-wallet'
import { t } from '@ui-kit/lib/i18n'
import { DAO_ROUTES } from '@ui-kit/shared/routes'
import { copyToClipboard } from '@ui-kit/utils'
import { errorFallback } from '@ui-kit/utils/error.util'
import BackButton from '../BackButton'
import ProposalVoteStatusBox from '../ProposalVoteStatusBox'
import UserBox from '../UserBox'
Expand Down Expand Up @@ -72,7 +73,7 @@ export const Proposal = ({ proposalId: rProposalId, network }: ProposalUrlParams
setSnapshotVeCrv(signer, userAddress, proposal.block, rProposalId)
}

void getVeCrv()
getVeCrv().catch(errorFallback)
}
}, [provider, rChainId, rProposalId, setSnapshotVeCrv, proposal?.block, snapshotVeCrv, userAddress])

Expand Down
5 changes: 3 additions & 2 deletions apps/main/src/dao/components/PageUser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Box from '@ui/Box'
import { useWallet } from '@ui-kit/features/connect-wallet'
import { t } from '@ui-kit/lib/i18n'
import { TabsSwitcher, type TabOption } from '@ui-kit/shared/ui/TabsSwitcher'
import { errorFallback } from '@ui-kit/utils/error.util'
import UserGaugeVotesTable from './UserGaugeVotesTable'
import UserHeader from './UserHeader'
import UserLocksTable from './UserLocksTable'
Expand Down Expand Up @@ -51,14 +52,14 @@ const UserPage = ({ routerParams: { userAddress: rUserAddress } }: UserPageProps

useEffect(() => {
if (Object.keys(allHolders).length === 0 && holdersLoading && !holdersError) {
void getVeCrvHolders()
getVeCrvHolders().catch(errorFallback)
}
}, [getVeCrvHolders, allHolders, holdersLoading, holdersError])

// Get user ENS
useEffect(() => {
if (!userMapper[userAddress] && provider) {
void getUserEns(userAddress)
getUserEns(userAddress).catch(errorFallback)
}
}, [getUserEns, userAddress, userMapper, provider])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import usePageVisibleInterval from '@ui-kit/hooks/usePageVisibleInterval'
import dayjs from '@ui-kit/lib/dayjs'
import { t } from '@ui-kit/lib/i18n'
import { REFRESH_INTERVAL } from '@ui-kit/lib/model'
import { errorFallback } from '@ui-kit/utils/error.util'
import { useThrottle } from '@ui-kit/utils/timers'

const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) => {
const isSubscribed = useRef(false)
Expand All @@ -34,7 +36,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>
const formValues = useStore((state) => state.lockedCrv.formValues)
const fetchStepApprove = useStore((state) => state.lockedCrv.fetchStepApprove)
const fetchStepCreate = useStore((state) => state.lockedCrv.fetchStepCreate)
const setFormValues = useStore((state) => state.lockedCrv.setFormValues)
const setFormValues = useThrottle(useStore((state) => state.lockedCrv.setFormValues))

const [steps, setSteps] = useState<Step[]>([])
const [txInfoBar, setTxInfoBar] = useState<ReactNode>(null)
Expand All @@ -46,9 +48,9 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>
const maxUtcDate = dayjs.utc().add(4, 'year')

const updateFormValues = useCallback(
(updatedFormValues: Partial<FormValues>, isFullReset?: boolean) => {
async (updatedFormValues: Partial<FormValues>, isFullReset?: boolean) => {
setTxInfoBar(null)
setFormValues(curve, isLoadingCurve, rFormType, updatedFormValues, vecrvInfo, isFullReset)
await setFormValues(curve, isLoadingCurve, rFormType, updatedFormValues, vecrvInfo, isFullReset)
},
[curve, isLoadingCurve, vecrvInfo, rFormType, setFormValues],
)
Expand All @@ -75,7 +77,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>
days,
},
false,
)
).catch(errorFallback)
},
[currUtcDate, haveSigner, maxUtcDate, minUtcDate, rChainId, updateFormValues],
)
Expand All @@ -87,15 +89,21 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>
if (!value || !unit) {
const days = maxUtcDate.diff(currUtcDate, 'd')
const calcdUtcDate = calcUnlockTime(curve, 'create', null, days)
updateFormValues({ utcDate: toCalendarDate(calcdUtcDate), utcDateError: '', days, calcdUtcDate: '' }, false)
updateFormValues(
{ utcDate: toCalendarDate(calcdUtcDate), utcDateError: '', days, calcdUtcDate: '' },
false,
).catch(errorFallback)
return maxUtcDate
}

const utcDate = dayjs.utc().add(value, unit)
const days = utcDate.diff(currUtcDate, 'd')
const calcdUtcDate = calcUnlockTime(curve, 'create', null, days)

updateFormValues({ utcDate: toCalendarDate(calcdUtcDate), utcDateError: '', days, calcdUtcDate: '' }, false)
updateFormValues(
{ utcDate: toCalendarDate(calcdUtcDate), utcDateError: '', days, calcdUtcDate: '' },
false,
).catch(errorFallback)
return utcDate
},
[currUtcDate, maxUtcDate, rChainId, updateFormValues],
Expand Down Expand Up @@ -185,7 +193,7 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>
// onMount
useEffect(() => {
isSubscribed.current = true
updateFormValues({}, true)
updateFormValues({}, true).catch(errorFallback)

return () => {
isSubscribed.current = false
Expand Down Expand Up @@ -223,7 +231,10 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>
haveSigner={haveSigner}
formType={rFormType}
vecrvInfo={vecrvInfo}
handleInpLockedAmt={useCallback((lockedAmt) => updateFormValues({ lockedAmt }, false), [updateFormValues])}
handleInpLockedAmt={useCallback(
(lockedAmt) => updateFormValues({ lockedAmt }, false).catch(errorFallback),
[updateFormValues],
)}
{...formValues}
/>

Expand Down Expand Up @@ -254,7 +265,10 @@ const FormLockCreate = ({ curve, rChainId, rFormType, vecrvInfo }: PageVecrv) =>

<FormActions haveSigner={haveSigner} loading={loading}>
{formStatus.error && (
<AlertFormError errorKey={formStatus.error} handleBtnClose={() => updateFormValues({}, false)} />
<AlertFormError
errorKey={formStatus.error}
handleBtnClose={() => updateFormValues({}, false).catch(errorFallback)}
/>
)}
{txInfoBar}
<Stepper steps={steps} />
Expand Down
Loading
Loading