Skip to content
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

chore: Properly ignore supposedly ignored errors #10580

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions packages/client/Atmosphere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export default class Atmosphere extends Environment {
: value
_next(nextObj)
}
this.handleSubscribePromise(operation, variables, _cacheConfig, sink).catch()
this.handleSubscribePromise(operation, variables, _cacheConfig, sink).catch(() => {
/*ignore*/
})
})
}

Expand Down Expand Up @@ -297,7 +299,9 @@ export default class Atmosphere extends Environment {
let data = request.id
if (!__PRODUCTION__) {
try {
const queryMap = await import('../../queryMap.json').catch()
const queryMap = await import('../../queryMap.json').catch(() => {
/*ignore*/
})
data = queryMap[request.id as keyof typeof queryMap] as string
} catch (e) {
return
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/ActionMeetingSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ const ActionMeetingSidebar = (props: Props) => {
} = itemStage || {}
const canNavigate = isViewerFacilitator ? isNavigableByFacilitator : isNavigable
const handleClick = () => {
gotoStageId(itemStageId).catch()
gotoStageId(itemStageId).catch(() => {
/*ignore*/
})
handleMenuClick()
}
const phaseCount =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ const ActionSidebarAgendaItemsSection = (props: Props) => {
)
const {team} = meeting
const handleClick = async (stageId: string) => {
gotoStageId(stageId).catch()
gotoStageId(stageId).catch(() => {
/*ignore*/
})
handleMenuClick()
}
// show agenda (no blur) at all times if the updates phase isNavigable
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/AnalyticsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ const AnalyticsPage = () => {
window.localStorage.setItem(LocalStorageKey.EMAIL, email)
safeIdentify(atmosphere.viewerId, email)
}
cacheEmail().catch()
cacheEmail().catch(() => {
/*ignore*/
})
}, [])

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ class AtmosphereProvider extends Component<Props> {
constructor(props: Props) {
super(props)
if (props.getLocalAtmosphere) {
this.loadDemo().catch()
this.loadDemo().catch(() => {
/*ignore*/
})
} else {
this.atmosphere = new Atmosphere()
this.atmosphere.getAuthToken(window)
}
}

async loadDemo() {
const LocalAtmosphere = await this.props.getLocalAtmosphere!()
.then((mod) => mod.default)
.catch()
const LocalAtmosphere = await this.props.getLocalAtmosphere!().then((mod) => mod.default)
this.atmosphere = new LocalAtmosphere()
this.forceUpdate()
}
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const AuthProvider = () => {
setError('Error logging in')
}
}
callOpener().catch()
callOpener().catch(() => {
/*ignore*/
})
}, [])

if (!error) return null
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/MassInvitationTokenLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ const MassInvitationTokenLink = (props: Props) => {
submitMutation()
CreateMassInvitationMutation(atmosphere, {meetingId, teamId}, {onError, onCompleted})
}
doFetch().catch()
doFetch().catch(() => {
/*ignore*/
})
}, [isTokenValid, submitting])
const onCopy = () => {
SendClientSideEvent(atmosphere, 'Copied Invite Link', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ const MeetingSidebarTeamMemberStageItems = (props: Props) => {
const teamMemberStage =
sidebarPhase && sidebarPhase.stages.find((stage) => stage.teamMemberId === teamMemberId)
const teamMemberStageId = (teamMemberStage && teamMemberStage.id) || ''
gotoStageId(teamMemberStageId).catch()
gotoStageId(teamMemberStageId).catch(() => {
/*ignore*/
})
handleMenuClick()
}
const atmosphere = useAtmosphere()
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/PokerMeetingSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ const PokerMeetingSidebar = (props: Props) => {
} = itemStage || {}
const canNavigate = isViewerFacilitator ? isNavigableByFacilitator : isNavigable
const handleClick = () => {
gotoStageId(itemStageId).catch()
gotoStageId(itemStageId).catch(() => {
/*ignore*/
})
handleMenuClick()
}
const estimatePhase = phases.find((phase) => {
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/PokerSidebarEstimateSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ const PokerSidebarEstimateSection = (props: Props) => {
const handleClick = (stageIds: string[]) => {
// if the facilitator is at one of the stages, go there
if (stageIds.includes(facilitatorStageId)) {
gotoStageId(facilitatorStageId).catch()
gotoStageId(facilitatorStageId).catch(() => {
/*ignore*/
})
} else {
// goto the first stage that the user hasn't voted on
const summaryStages = stageIds.map((id) => stages.find((stage) => stage.id === id))
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/RetroMeetingSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ const RetroMeetingSidebar = (props: Props) => {
confirmingPhase === phaseType
) {
setConfirmingPhase(null)
gotoStageId(itemStageId).catch()
gotoStageId(itemStageId).catch(() => {
/*ignore*/
})
handleMenuClick()
} else {
setConfirmingPhase(phaseType)
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/RetroSidebarDiscussSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ const RetroSidebarDiscussSection = (props: Props) => {
}

const handleClick = (id: string) => {
gotoStageId(id).catch()
gotoStageId(id).catch(() => {
/*ignore*/
})
handleMenuClick()
}
return (
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/TeamInvitationSSO.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ const TeamInvitationSSO = (props: Props) => {
emitGA4SignUpEvent(ga4Args)
AcceptTeamInvitationMutation(atmosphere, {invitationToken}, {history, onCompleted, onError})
}
loginWithSAML().catch()
loginWithSAML().catch(() => {
/*ignore*/
})
}, [])
useDocumentTitle('SSO Login | Team Invitation', 'Team Invitation')

Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useAutoCheckIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ const useAutoCheckIn = (meetingRef: useAutoCheckIn_meeting$key) => {
const {id: meetingId, endedAt, viewerMeetingMember} = meeting
const subscribeToMeeting = () => {
if (atmosphere.registerQuery) {
atmosphere.registerQuery(queryKey, MeetingSubscription, {meetingId}, router).catch()
atmosphere.registerQuery(queryKey, MeetingSubscription, {meetingId}, router).catch(() => {
/*ignore*/
})
}
}
if (viewerMeetingMember) {
Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useGotoNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export const useGotoNext = (
const {stage} = nextStageRes
const {id: nextStageId} = stage
if (!options.isHotkey || currentStageRes.stage.isComplete) {
gotoStageId(nextStageId).catch()
gotoStageId(nextStageId).catch(() => {
/*ignore*/
})
} else if (options.isHotkey) {
ref.current && ref.current.focus()
}
Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useGotoPrev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export const useGotoPrev = (
const {
stage: {id: nextStageId}
} = nextStageRes
gotoStageId(nextStageId).catch()
gotoStageId(nextStageId).catch(() => {
/*ignore*/
})
}, [gotoStageId, meeting])
}

Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useSVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const useSVG = (src: string, onLoad?: (el: SVGElement) => void) => {
setSVG(res2)
}
}
fetchSVG().catch()
fetchSVG().catch(() => {
/*ignore*/
})
return () => {
isMountedRef.current = false
}
Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useServiceWorkerUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const useServiceWorkerUpdater = () => {
})
}
if ('serviceWorker' in navigator) {
setFirstServiceWorker().catch()
setFirstServiceWorker().catch(() => {
/*ignore*/
})
navigator.serviceWorker.addEventListener('controllerchange', onServiceWorkerChange)
return () => {
navigator.serviceWorker.removeEventListener('controllerchange', onServiceWorkerChange)
Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useSlackChannels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const useSlackChannels = (
availableChannels.unshift({...botChannel, name: '@Parabol'})
setChannels(availableChannels)
}
getChannels().catch()
getChannels().catch(() => {
/*ignore*/
})
return () => {
isMounted = false
}
Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const useSubscription = (
const router = {history, location}
useEffect(() => {
if (atmosphere.registerQuery) {
atmosphere.registerQuery(queryKey, subscription, variables, router).catch()
atmosphere.registerQuery(queryKey, subscription, variables, router).catch(() => {
/*ignore*/
})
}
return () => {
if (atmosphere.scheduleUnregisterQuery) {
Expand Down
4 changes: 3 additions & 1 deletion packages/client/hooks/useTrebuchetEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const useTrebuchetEvents = () => {
serverVersionRef.current = obj.version
if ('serviceWorker' in navigator) {
const registration = await navigator.serviceWorker.getRegistration()
registration?.update().catch()
registration?.update().catch(() => {
/*ignore*/
})
}
} else if (recentDisconnectsRef.current.length > 0) {
// retry if reconnect and versions are the same
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ const imageStyle = {
const ExportToCSV = (props: Props) => {
useEffect(() => {
if (props.urlAction === 'csv') {
exportToCSV().catch()
exportToCSV().catch(() => {
/*ignore*/
})
}
}, [props.urlAction])
const atmosphere = useAtmosphere()
Expand Down
4 changes: 3 additions & 1 deletion packages/server/billing/helpers/adjustUserCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export default async function adjustUserCount(
const organizations = await dataLoader.get('organizations').loadMany(orgIds)
const paidOrgs = organizations.filter(isValid).filter((org) => org.stripeSubscriptionId)

handleEnterpriseOrgQuantityChanges(paidOrgs, dataLoader).catch()
handleEnterpriseOrgQuantityChanges(paidOrgs, dataLoader).catch(() => {
/*ignore*/
})
handleTeamOrgQuantityChanges(paidOrgs).catch(Logger.error)
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ const sendEnterpriseOverageEvent = async (
({role}) => role && ['BILLING_LEADER', 'ORG_ADMIN'].includes(role)
)!
const {id: userId} = billingLeaderOrgUser
const user = await dataLoader.get('users').loadNonNull(userId)
analytics.enterpriseOverUserLimit(user, orgId)
const user = await dataLoader.get('users').load(userId)
if (user) {
analytics.enterpriseOverUserLimit(user, orgId)
}
}
}

Expand All @@ -37,7 +39,9 @@ const handleEnterpriseOrgQuantityChanges = async (
const enterpriseOrgs = paidOrgs.filter((org) => org.tier === 'enterprise')
if (enterpriseOrgs.length === 0) return
for (const org of enterpriseOrgs) {
sendEnterpriseOverageEvent(org, dataLoader).catch()
sendEnterpriseOverageEvent(org, dataLoader).catch(() => {
/*ignore*/
})
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/server/graphql/mutations/createTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ export default {
handleAddTaskNotifications(teamMembers, task, viewerId, teamId, {
operationId,
mutatorId
}).catch()
}).catch(() => {
/*ignore*/
})

const meeting = meetingId ? await dataLoader.get('newMeetings').load(meetingId) : undefined
const taskProperties = {
Expand Down
4 changes: 3 additions & 1 deletion packages/server/graphql/subscribeGraphQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ const subscribeGraphQL = async (req: SubscribeRequest) => {
if (resubIdx !== -1) {
// reinitialize the subscription
connectionContext.availableResubs.splice(resubIdx, 1)
subscribeGraphQL({...req, hideErrors: true}).catch()
subscribeGraphQL({...req, hideErrors: true}).catch(() => {
/*ignore*/
})
} else {
sendGQLMessage(connectionContext, opId, 'complete', false)
}
Expand Down
Loading