You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-11-25] [$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage #106883
Component: DynamicReportDetailsPage; recorded native view: Settings_Profile.
Top first-party frame
DynamicReportDetailsPage (index.tsx)
Followed by React Native Fabric render frames: renderWithHooks → beginWork → renderRootSync. Sentry’s source-line mapping appears inaccurate.
Likely root cause
The affected release’s component reads route.params.reportID without checking whether route.params exists. Missing navigation parameters cause the reported TypeError before ReportOrNotFoundGuard renders.
The exact navigation sequence producing missing parameters is not yet confirmed. An unloaded report alone does not explain this failure.
Suggested fix
Safely read the optional route parameters and handle a missing :reportID without throwing.
Investigate navigation/restoration paths that can mount this screen without its required parameters.
Add regression coverage for undefined route parameters and normal report loading.
Duplicate check
No matching tracker found in Expensify/App or Expensify/Expensify. Historical exact-error matches concern unrelated task-assignment and CSV-export bugs.
changed the title [-][Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/-][+][$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/+]on Nov 13, 2026
route.params.reportID unconditionally dereferences route.params. When route.params is undefined (or omitted by React Navigation during restoration or empty navigations), JavaScript throws a fatal TypeError before ReportOrNotFoundGuard can mount.
ReportOrNotFoundGuard is specifically designed to safely accept an optional/undefined reportID (reportID: string | undefined;). When reportID is undefined, isReportIdInRoute evaluates to false (!!reportID?.length), and getReportOrNotFoundDecision gracefully falls back to 'notFound' rendering <NotFoundPage isReportRelatedPage /> without crashing. However, because route.params.reportID throws beforehand, the guard never gets the chance to execute.
Pass reportID ?? '' to <ReportDetailsContent reportID={reportID ?? ''} />. When reportID is undefined or empty, ReportOrNotFoundGuard handles it gracefully and renders <NotFoundPage isReportRelatedPage /> without mounting ReportDetailsContent.
Add a unit test verifying that DynamicReportDetailsPage renders <NotFoundPage /> without crashing when mounted with route={{params: undefined} as any} or {}.
What alternative solutions did you explore? (Optional)
Throwing an error boundary / redirecting to Home on mount when route.params is absent: Rejected because ReportOrNotFoundGuard already provides the standardized, established pattern across the entire application for handling missing report IDs via NotFoundPage. Defensively reading route?.params?.reportID allows the guard to perform its intended job seamlessly.
Medium confidence: the affected release reads route.params.reportID before rendering its not-found guard. If route.params is undefined, this produces the reported TypeError.
There is a concrete source-level path to that state: /search/details is accepted by the dynamic routing configuration, but without report context or query parameters its generated details route omits params. This is a candidate trigger, not a confirmed reproduction of the reported iOS event.
An unloaded report alone does not explain this dereference. Likewise, params: {} returns an undefined ID without throwing at this expression.
What changes do you think we should make in order to solve the problem?
Safely extract the ID with route.params?.reportID, retaining the existing guard. Pass reportID ?? '' only to the string-typed content prop.
Add regression coverage that mounts the actual page with undefined parameters, empty parameters, and a valid report ID.
Test missing-ID behavior with global report loading unset, active, and finished, plus normal report loading.
Correction to the existing proposal: missing parameters do not necessarily produce an immediate not-found page. The guard can show a loading indicator until global report loading finishes. Optional chaining prevents the crash but does not change that behavior.
Scope and validation limits
ReportOrNotFoundGuard.tsx:54–75 prioritizes loading over not-found. If immediate rejection of a missing required ID is desired, that should be an explicit, separately tested behavior change preserving optional-ID callers and navigation/deletion transitions.
The proposed Export-page and HOC hardening addresses separate accesses; neither is necessary to repair this component’s demonstrated crash mechanism.
No runtime reproduction was performed. Production confirmation was blocked by unavailable Sentry access. The event’s symbolicated frame and navigation/deep-link breadcrumbs are needed to establish the actual trigger; Settings_Profile metadata alone cannot do that.
What alternative solutions did you explore? (Optional)
Fixing navigation alone would leave the component vulnerable to malformed routes. Defensive extraction is the smallest crash-prevention change; identifying the production navigation trigger remains a separate investigation.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/106883) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-][$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/-][+][Due for payment 2026-11-25] [$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/+]on Nov 18, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-11-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A — No core-flow interruption was established.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Sign in to the iOS App with a test account that can access an existing report. Note its report ID.
Test:
Open new-expensify://search/details without a report ID. Once loading finishes, verify Not Found appears and the App does not crash.
Tap Go back. Verify you can continue using the App.
Open new-expensify://search/details?reportID=<reportID> with the existing report ID. Verify the correct report details appear.
Activity
melvin-bot commentedon Nov 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (
External)[-][Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/-][+][$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/+]melvin-bot commentedon Nov 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022121292108607915772
kevinjosh10 commentedon Nov 13, 2026
Proposal
What is the root cause of that problem?
In
src/pages/DynamicReportDetailsPage/index.tsx:14-22:route.params.reportIDunconditionally dereferencesroute.params. Whenroute.paramsisundefined(or omitted by React Navigation during restoration or empty navigations), JavaScript throws a fatalTypeErrorbeforeReportOrNotFoundGuardcan mount.ReportOrNotFoundGuardis specifically designed to safely accept an optional/undefinedreportID(reportID: string | undefined;). WhenreportIDisundefined,isReportIdInRouteevaluates tofalse(!!reportID?.length), andgetReportOrNotFoundDecisiongracefully falls back to'notFound'rendering<NotFoundPage isReportRelatedPage />without crashing. However, becauseroute.params.reportIDthrows beforehand, the guard never gets the chance to execute.src/pages/inbox/report/DynamicReportDetailsExportPage.tsx:38-40,connectionNameis read defensively withroute?.params?.connectionName, butreportIDis read asroute.params.reportID. And insrc/pages/inbox/report/withReportOrNotFound.tsx:78-83,const params = props.route.params;does not check ifparamsexists before checking'notificationReportID' in params.What changes do you think we should make in order to solve the problem?
Safely read
reportIDinDynamicReportDetailsPage/index.tsx:src/pages/DynamicReportDetailsPage/index.tsx:14-22, use optional chaining:reportID ?? ''to<ReportDetailsContent reportID={reportID ?? ''} />. WhenreportIDisundefinedor empty,ReportOrNotFoundGuardhandles it gracefully and renders<NotFoundPage isReportRelatedPage />without mountingReportDetailsContent.Defensively guard sibling screens and HOC:
src/pages/inbox/report/DynamicReportDetailsExportPage.tsx:40, updateroute.params.reportIDtoroute?.params?.reportID.src/pages/inbox/report/withReportOrNotFound.tsx:79-83, safely checkparams:Add regression tests:
tests/ui/DynamicReportDetailsPageTest.tsx:DynamicReportDetailsPagerenders<NotFoundPage />without crashing when mounted withroute={{params: undefined} as any}or{}.What alternative solutions did you explore? (Optional)
route.paramsis absent: Rejected becauseReportOrNotFoundGuardalready provides the standardized, established pattern across the entire application for handling missing report IDs viaNotFoundPage. Defensively readingroute?.params?.reportIDallows the guard to perform its intended job seamlessly.Contributor details
Your Expensify account email: lkevinjosh10@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0131dae36abcf59374
melvin-bot commentedon Nov 13, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
MelvinBot commentedon Nov 13, 2026
Proposal
What is the root cause of that problem?
Medium confidence: the affected release reads
route.params.reportIDbefore rendering its not-found guard. Ifroute.paramsis undefined, this produces the reported TypeError.There is a concrete source-level path to that state:
/search/detailsis accepted by the dynamic routing configuration, but without report context or query parameters its generated details route omitsparams. This is a candidate trigger, not a confirmed reproduction of the reported iOS event.Code evidence and alternatives checked
paramsbefore the guard runs.paramswhen that merged set is empty.params: {}returns an undefined ID without throwing at this expression.What changes do you think we should make in order to solve the problem?
route.params?.reportID, retaining the existing guard. PassreportID ?? ''only to the string-typed content prop.Correction to the existing proposal: missing parameters do not necessarily produce an immediate not-found page. The guard can show a loading indicator until global report loading finishes. Optional chaining prevents the crash but does not change that behavior.
Scope and validation limits
ReportOrNotFoundGuard.tsx:54–75 prioritizes loading over not-found. If immediate rejection of a missing required ID is desired, that should be an explicit, separately tested behavior change preserving optional-ID callers and navigation/deletion transitions.
The proposed Export-page and HOC hardening addresses separate accesses; neither is necessary to repair this component’s demonstrated crash mechanism.
No runtime reproduction was performed. Production confirmation was blocked by unavailable Sentry access. The event’s symbolicated frame and navigation/deep-link breadcrumbs are needed to establish the actual trigger;
Settings_Profilemetadata alone cannot do that.What alternative solutions did you explore? (Optional)
Fixing navigation alone would leave the component vulnerable to malformed routes. Defensive extraction is the smallest crash-prevention change; identifying the production navigation trigger remains a separate investigation.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/106883)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
14 remaining items
melvin-bot commentedon Nov 15, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
[-][$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/-][+][Due for payment 2026-11-25] [$175] [Sentry: APP-P65] TypeError: Cannot read property 'reportID' of undefined in DynamicReportDetailsPage[/+]melvin-bot commentedon Nov 18, 2026
@nyomanjyotisa
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.41-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-11-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
nyomanjyotisa commentedon Nov 19, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: BT Migrate Report Core 1 #90113 (comment)
Link to the comment on the Issue: [BT-129] Migrate Reports - Core (Part 1) #83365 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A — No core-flow interruption was established.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Test:
new-expensify://search/detailswithout a report ID. Once loading finishes, verify Not Found appears and the App does not crash.new-expensify://search/details?reportID=<reportID>with the existing report ID. Verify the correct report details appear.Do we agree 👍 or 👎