Skip to content

Fix the crash of the app page when object view is configured to open only on record page.#16977

Merged
charlesBochet merged 11 commits intotwentyhq:mainfrom
araj00:16577-crash-app-page
Jan 8, 2026
Merged

Fix the crash of the app page when object view is configured to open only on record page.#16977
charlesBochet merged 11 commits intotwentyhq:mainfrom
araj00:16577-crash-app-page

Conversation

@araj00
Copy link
Copy Markdown
Contributor

@araj00 araj00 commented Jan 6, 2026

Problem:

If the command menu page is kept opened while navigating to record show page then the app crashes.

Root cause

When navigatiing to a record show page while the command menu page is kept opened, it tries to open the record show page with command menu open, as its state were set to true , before navigating to a new page along with the instance id of previous context which are used in the current context while rendering the page. Hence, leading to an error page.

Changes

while navigation to a record show page the command menu open state is set to false. This is to handle the navigation gracefully

Fixes: #16577

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 6, 2026

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:14871

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.ts">

<violation number="1" location="packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.ts:88">
P2: Missing `closeCommandMenu` in the `useRecoilCallback` dependency array. While `closeCommandMenu` is memoized in `useCommandMenu`, it should still be listed as a dependency to ensure correctness and avoid potential stale closure issues.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

resetNavigationStack: true,
});
} else {
closeCommandMenu();
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Missing closeCommandMenu in the useRecoilCallback dependency array. While closeCommandMenu is memoized in useCommandMenu, it should still be listed as a dependency to ensure correctness and avoid potential stale closure issues.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-front/src/modules/object-record/record-index/hooks/useOpenRecordFromIndexView.ts, line 88:

<comment>Missing `closeCommandMenu` in the `useRecoilCallback` dependency array. While `closeCommandMenu` is memoized in `useCommandMenu`, it should still be listed as a dependency to ensure correctness and avoid potential stale closure issues.</comment>

<file context>
@@ -83,7 +85,7 @@ export const useOpenRecordFromIndexView = () => {
           });
         } else {
-          set(isCommandMenuOpenedState, false);
+          closeCommandMenu();
           navigate(AppPath.RecordShowPage, {
             objectNameSingular,
</file context>

✅ Addressed in a7ca1a8

Comment on lines 113 to 114
closeCommandMenu();
await createNewIndexRecord({

This comment was marked as outdated.

onClick={() => {
createNewIndexRecord({
onClick={async () => {
closeCommandMenu();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel:

  • this should actually be part of createNewIndexRecord
  • and we should call it only if the view is set to navigate to a new record page

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done the suggested changes. Please check on it.

resetNavigationStack: true,
});
} else {
closeCommandMenu();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one looks good

@charlesBochet charlesBochet added this pull request to the merge queue Jan 8, 2026
Merged via the queue into twentyhq:main with commit 7ce7627 Jan 8, 2026
64 checks passed
@twenty-eng-sync
Copy link
Copy Markdown

Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@twenty-eng-sync
Copy link
Copy Markdown

Hey @charlesBochet! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 8, 2026

Thanks @araj00 for your contribution!
This marks your 2nd PR on the repo. You're top 15% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

@araj00 araj00 deleted the 16577-crash-app-page branch January 8, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when navigating to record page with command menu open

2 participants