VOK-160 Linear desktop pages fail when no Foreman node is selected#158
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Request
Prompt context:
<title>Linear desktop pages fail when no Foreman node is selected</title> ## SummaryThe node-scoped hosted Linear change now makes the proxy Linear routes reject requests unless
X-Foreman-Node-Idis set to a real owned node. The desktop Linear surfaces still load those routes immediately on mount without checking auth state first, so an unpaired desktop or a proxy session with no selected node now lands in a raw hosted-Linear error path instead of a guided "pair/select a node first" state.Concrete repo evidence
Recent commits in scope:
34dcaf87dd23ad0eaf56fb03065ecc67cd6378c8Fix node-scoped Linear disconnectde8aa8020c78ca43617ea29b60775187604f867cValidate Linear node scopeProxy now hard-requires a selected node before any hosted Linear management call:
foreman-proxy/src/api/linear.rs:46-66require_selected_node_scope(...)returns400 bad_requestwithSelect a Foreman node before managing Linear connections.when the node header is missing.foreman-proxy/src/api/linear.rs:155-209GET /integrations/linear/connections,GET /integrations/linear/connections/{id}/catalog, andDELETE /integrations/linear/connections/{id}all call that guard.Desktop Linear pages still call those routes immediately without checking whether the desktop actually has a selected node:
foreman-desktop/src/features/projects/components/LinearPageView.tsx:67-96loadData()immediately callsgetLinearConnectionsStatus()on mount.foreman-desktop/src/features/projects/components/ProjectLinearBindingSection.tsx:80-129getLinearConnectionsStatus()on mount as well.The desktop already has auth-state plumbing that exposes
selectedNodeId, but these Linear surfaces do not use it:foreman-desktop/src/lib/api.ts:744-760ForemanAuthStateSchemaincludeshasNodeSessionandselectedNodeId.foreman-desktop/src/features/projects/components/GithubRepositoriesPageView.tsx:29-41getForemanAuthState()first and uses it to gate node-dependent actions.User-visible failure
Any desktop session that has a proxy session but no selected Foreman node can now open the hosted Linear page or a project settings page and hit the proxy
bad_requestpath immediately, instead of seeing the same kind of explicit "pair/select a node" guidance already used on the GitHub import surface.Minimal safe fix
getForemanAuthState()before the initial hosted Linear fetches inLinearPageViewandProjectLinearBindingSection.selectedNodeIdis missing, skipgetLinearConnectionsStatus()/ catalog requests and render an instructional empty or warning state.This keeps the new proxy node-scope contract intact and fixes the desktop regression at the actual caller boundary instead of weakening the proxy validation.
Bug
Linear issue VOK-160: Linear desktop pages fail when no Foreman node is selected
Issue URL: https://linear.app/vokality/issue/VOK-160/linear-desktop-pages-fail-when-no-foreman-node-is-selected
Team: Vokality
State: Todo
Labels: Bug
Summary
The node-scoped hosted Linear change now makes the proxy Linear routes reject requests unless
X-Foreman-Node-Idis set to a real owned node. The desktop Linear surfaces still load those routes immediately on mount without checking auth state first, so an unpaired desktop or a proxy session with no selected node now lands in a raw hosted-Linear error path instead of a guided "pair/select a node first" state.Concrete repo evidence
Recent commits in scope:
34dcaf87dd23ad0eaf56fb03065ecc67cd6378c8Fix node-scoped Linear disconnectde8aa8020c78ca43617ea29b60775187604f867cValidate Linear node scopeProxy now hard-requires a selected node before any hosted Linear management call:
foreman-proxy/src/api/linear.rs:46-66require_selected_node_scope(...)returns400 bad_requestwithSelect a Foreman node before managing Linear connections.when the node header is missing.foreman-proxy/src/api/linear.rs:155-209GET /integrations/linear/connections,GET /integrations/linear/connections/{id}/catalog, andDELETE /integrations/linear/connections/{id}all call that guard.Desktop Linear pages still call those routes immediately without checking whether the desktop actually has a selected node:
foreman-desktop/src/features/projects/components/LinearPageView.tsx:67-96loadData()immediately callsgetLinearConnectionsStatus()on mount.foreman-desktop/src/features/projects/components/ProjectLinearBindingSection.tsx:80-129getLinearConnectionsStatus()on mount as well.The desktop already has auth-state plumbing that exposes
selectedNodeId, but these Linear surfaces do not use it:foreman-desktop/src/lib/api.ts:744-760ForemanAuthStateSchemaincludeshasNodeSessionandselectedNodeId.foreman-desktop/src/features/projects/components/GithubRepositoriesPageView.tsx:29-41getForemanAuthState()first and uses it to gate node-dependent actions.User-visible failure
Any desktop session that has a proxy session but no selected Foreman node can now open the hosted Linear page or a project settings page and hit the proxy
bad_requestpath immediately, instead of seeing the same kind of explicit "pair/select a node" guidance already used on the GitHub import surface.Minimal safe fix
getForemanAuthState()before the initial hosted Linear fetches inLinearPageViewandProjectLinearBindingSection.selectedNodeIdis missing, skipgetLinearConnectionsStatus()/ catalog requests and render an instructional empty or warning state.This keeps the new proxy node-scope contract intact and fixes the desktop regression at the actual caller boundary instead of weakening the proxy validation.
Session comment:
This thread is for an agent session with foreman.
Summary
Gated desktop Linear surfaces on selected-node auth and added regression coverage
Checks
foreman-server-format: passed (exit status 0)foreman-server-checks: passed (exit status 0)foreman-server-tests: passed (exit status 0)Foreman Metadata
019de3c4-d38d-74a3-bda1-e51dd7c94eb9019de3c7-5cf4-7741-9dcc-13639e948bfa019de3c7-5b99-72f1-a59b-0ccf860d19381foreman/019de3c4-d38d-74a3-bda1-e51dd7c94eb9