fix: Fix broken state from an invalid folderId in the path#8790
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes remove two debugging console statements from a custom node component and add a folder existence validation in the home page. The new logic checks if the folder ID in the URL matches an existing folder and redirects to "/all" if not found. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HomePage
participant Store
participant Router
User->>HomePage: Navigates to HomePage with folderId in URL
HomePage->>Store: Retrieves folders list
HomePage->>HomePage: useEffect checks if folderId exists in folders
alt folderId not found
HomePage->>Router: Redirect to "/all"
end
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/frontend/src/CustomNodes/NoteNode/index.tsx(1 hunks)src/frontend/src/pages/MainPage/pages/homePage/index.tsx(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/frontend/**/*.{ts,tsx}`: Use React 18 with TypeScript for all UI components and frontend logic.
src/frontend/**/*.{ts,tsx}: Use React 18 with TypeScript for all UI components and frontend logic.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)
List of files the instruction was applied to:
src/frontend/src/CustomNodes/NoteNode/index.tsxsrc/frontend/src/pages/MainPage/pages/homePage/index.tsx
`src/frontend/**/*.{ts,tsx,js,jsx,css,scss}`: Use Tailwind CSS for styling all frontend components.
src/frontend/**/*.{ts,tsx,js,jsx,css,scss}: Use Tailwind CSS for styling all frontend components.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)
List of files the instruction was applied to:
src/frontend/src/CustomNodes/NoteNode/index.tsxsrc/frontend/src/pages/MainPage/pages/homePage/index.tsx
🧠 Learnings (2)
src/frontend/src/CustomNodes/NoteNode/index.tsx (2)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: React Flow should be used for flow graph visualization, with nodes and edges passed as props, and changes handled via onNodesChange and onEdgesChange callbacks.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.
src/frontend/src/pages/MainPage/pages/homePage/index.tsx (5)
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/**/*.{ts,tsx} : Use React 18 with TypeScript for all UI components and frontend logic.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/stores/**/*.{ts,tsx} : Use Zustand for state management in frontend stores.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/{components,hooks}/**/*.{ts,tsx} : Implement dark mode support in components and hooks where needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-30T14:40:29.494Z
Learning: Applies to src/frontend/src/components/**/*FlowGraph.tsx : Use React Flow for flow graph visualization components.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: autofix
🔇 Additional comments (3)
src/frontend/src/CustomNodes/NoteNode/index.tsx (1)
87-87: LGTM! Good cleanup of debugging statements.Removing console.log statements improves production code quality and reduces unnecessary runtime logging noise.
src/frontend/src/pages/MainPage/pages/homePage/index.tsx (2)
11-11: LGTM! Appropriate import for navigation functionality.The custom navigation hook import aligns with the folder validation feature being implemented.
34-34: LGTM! Proper hook initialization.The navigation hook is correctly initialized and will be stable across re-renders.
* Fix the invalid folderId path * log fix
…ai#8790) * Fix the invalid folderId path * log fix
* Fix the invalid folderId path * log fix
* Fix the invalid folderId path * log fix
* Fix the invalid folderId path * log fix
The Bug
Discovered during superuser and new user testing there was a stale state when a user logged in to new users account when the login url contained a redirect to a specific folder which the now active user did not have.
The easier way to reproduce is just to update the folderId to something incorrect
the fix
Adds a simple check to see if the id in the url matches one of the users folders if not we redirect to
/allSummary by CodeRabbit