Skip to content

Show RDP for Linux and FreeBSD peers and harden the browser RDP client - #710

Merged
lixmal merged 2 commits into
mainfrom
ship/rdp-linux-slowpath
Jul 15, 2026
Merged

Show RDP for Linux and FreeBSD peers and harden the browser RDP client#710
lixmal merged 2 commits into
mainfrom
ship/rdp-linux-slowpath

Conversation

@lixmal

@lixmal lixmal commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Issue ticket number and link

Fixes #616

Shows the RDP button for Linux and FreeBSD peers (previously Windows-only) and hardens the browser RDP client's error handling and resize behavior.

  • Render the RDP button for Windows, Linux, and FreeBSD peers instead of Windows only
  • Surface RDP session errors as a notification and return to the connect screen instead of leaving a blank window
  • Show readable IronRDP error messages, mapping the error kind to a clear message
  • Default the connect username per OS (Administrator on Windows, root otherwise)
  • Resize the live session in place on Windows via the Display Control channel, falling back to reconnect on other hosts
  • Pin the IronRDP WASM package to the 0.0.2 release

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

The docs already state RDP has no OS restriction; this aligns the UI with that.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

E2E tests

Optional: override the image tags used by the Playwright e2e workflow.
Defaults to main when omitted.

management-cloud-tag: main
reverse-proxy-tag: main

Summary by CodeRabbit

  • New Features

    • RDP actions are now available for Windows, Linux, and FreeBSD hosts (not Windows-only).
    • Added optional dynamic in-session display resizing to reduce reconnects during window resizing.
    • RDP credentials now default to “Administrator” on Windows and “root” on other supported systems.
  • Bug Fixes

    • Improved RDP session error handling with clearer error messages and automatic recovery back to the credentials screen for retry.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0445bafe-df41-45d1-9b92-d44b9a380bbb

📥 Commits

Reviewing files that changed from the base of the PR and between d3cf259 and d636544.

📒 Files selected for processing (2)
  • src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts
  • src/modules/remote-access/rdp/useRemoteDesktop.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/modules/remote-access/rdp/useRemoteDesktop.ts
  • src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts

📝 Walkthrough

Walkthrough

The RDP client adds Linux and FreeBSD entry points, OS-specific credentials, Windows display-control resizing, session recovery, structured IronRDP errors, and pinned v0.0.2 release artifacts.

Changes

RDP client behavior

Layer / File(s) Summary
Bridge contracts and error decoding
src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts
IronRDP extension, resizing, configuration, and structured error contracts are extended.
Bridge lifecycle and display control
src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts
Optional setup, display-control registration, session-end callbacks, error decoding, and resize forwarding are implemented.
In-session resize orchestration
src/modules/remote-access/rdp/useRemoteDesktop.ts
Dynamic resizing uses the active session when enabled and retains reconnect behavior otherwise.
OS-aware RDP entry and recovery
src/app/(remote-access)/peer/rdp/page.tsx, src/modules/remote-access/rdp/RDPButton.tsx, src/modules/remote-access/rdp/RDPCredentialsModal.tsx
RDP controls support Windows, Linux, and FreeBSD; credentials use OS-specific defaults; dropped sessions return to the credentials screen.

IronRDP release pinning

Layer / File(s) Summary
Pin IronRDP release artifacts
.github/workflows/build_and_push.yml
TypeScript, JavaScript, and WASM downloads use the v0.0.2 release tag.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RDPPage
  participant useRemoteDesktop
  participant IronRDPWASMBridge
  participant RDPSession
  RDPPage->>useRemoteDesktop: start RDP with dynamicResize
  useRemoteDesktop->>IronRDPWASMBridge: connect(enableDisplayControl)
  IronRDPWASMBridge->>RDPSession: start session
  useRemoteDesktop->>IronRDPWASMBridge: resize(sessionId, width, height)
  IronRDPWASMBridge->>RDPSession: resize(width, height)
Loading

Poem

A rabbit hops where RDP can flow,
Linux joins the screen-show.
Windows stretches, sessions mend,
Errors find a readable friend.
Pinned releases keep builds bright—
Thump, thump, resize right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The RDP error-handling, resize, readable-error, and WASM pinning changes go beyond the Linux-peer button fix in #616. Split the browser-client hardening and IronRDP pinning into separate PRs, or link additional issues that explicitly cover them.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: expanding RDP peer support and hardening the browser client.
Description check ✅ Passed The description includes the issue link, docs decision, docs PR URL, and the optional E2E tag fields.
Linked Issues check ✅ Passed The PR addresses #616 by showing the RDP button for Linux peers and keeping the RDP page usable for those targets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ship/rdp-linux-slowpath

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: one or more packages not found in the registry.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts (2)

159-160: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Verify the "display_control" extension identifier matches the pinned IronRDP wasm build.

Devolutions/IronRDP's own architecture docs refer to this capability as displayControl (camelCase) when describing the backend-extension mechanism, while this code registers new this.ironrdp.Extension("display_control", true) (snake_case). If the pinned ironrdp-web/iron-remote-desktop-rdp v0.0.2 build expects a different literal string, Extension construction/registration would silently no-op or throw, and Windows in-session resize (the feature this branch exists for) would quietly fall back to not resizing, with no error surfaced to the user.

Please confirm the exact extension key accepted by the pinned wasm build (e.g., check iron-remote-desktop-rdp's Extension factory source for v0.0.2).

Also, connect() now takes 10 positional parameters (hostname, port, username, password, domain, canvas, enableClipboard, netbirdClient, onSessionEnd, enableDisplayControl). This is fragile to reorder mistakes at the single call site. Consider bundling the trailing options into a single object parameter.

Also applies to: 193-201

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts` around lines 159 - 160,
Verify the extension key used by the pinned IronRDP wasm v0.0.2 build against
its Extension factory, then update the registration in connect() to use the
exact accepted identifier while preserving display-control resizing. Also
replace connect()’s trailing positional options with a named options object, and
update its sole call site to pass enableClipboard, netbirdClient, onSessionEnd,
and enableDisplayControl by name.

83-106: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Enum-index mapping to kind() is fragile across wasm builds.

IRON_ERROR_KIND_NAMES hard-codes IronErrorKind ordering by array position. If the pinned ironrdp-web package (or a future bump of it) reorders/adds variants, kind() will silently map to the wrong human-readable message (or "Unknown" in logIronError) with no compile-time signal. The pin to v0.0.2 mitigates near-term drift, but this coupling is worth guarding with a small unit test asserting array length/order against a known-good sample, so a future version bump surfaces the mismatch instead of silently mislabeling errors.

Also applies to: 400-400

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts` around lines 83 - 106,
The IRON_ERROR_KIND_NAMES array relies on fragile numeric ordering from
IronRDP’s wasm kind() method. Add a focused unit test covering its expected
length and variant order for the pinned ironrdp-web version, so future enum
changes fail visibly; keep the existing mapping and IRON_ERROR_KIND_MESSAGES
behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts`:
- Around line 251-268: Update the startSession flow and its consumer so
superseded sessions cannot reset active connection state: before invoking
onSessionEnd, verify the session/sessionId still matches the current session
tracked by useRemoteDesktop.ts, or suppress the callback when it does not.
Preserve cleanup and error reporting for every settled run while preventing
stale callbacks from calling resetState().

In `@src/modules/remote-access/rdp/useRemoteDesktop.ts`:
- Around line 193-197: Update the onSessionEnd callback in useRemoteDesktop to
capture the session id associated with the current run and compare it with the
active session id before calling resetState or setError. Ignore callbacks from
stale sessions, while preserving existing error handling for the active session.

---

Nitpick comments:
In `@src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts`:
- Around line 159-160: Verify the extension key used by the pinned IronRDP wasm
v0.0.2 build against its Extension factory, then update the registration in
connect() to use the exact accepted identifier while preserving display-control
resizing. Also replace connect()’s trailing positional options with a named
options object, and update its sole call site to pass enableClipboard,
netbirdClient, onSessionEnd, and enableDisplayControl by name.
- Around line 83-106: The IRON_ERROR_KIND_NAMES array relies on fragile numeric
ordering from IronRDP’s wasm kind() method. Add a focused unit test covering its
expected length and variant order for the pinned ironrdp-web version, so future
enum changes fail visibly; keep the existing mapping and
IRON_ERROR_KIND_MESSAGES behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1cb4ff8c-a5bc-4209-a083-a21965545769

📥 Commits

Reviewing files that changed from the base of the PR and between 377d239 and d3cf259.

📒 Files selected for processing (6)
  • .github/workflows/build_and_push.yml
  • src/app/(remote-access)/peer/rdp/page.tsx
  • src/modules/remote-access/rdp/RDPButton.tsx
  • src/modules/remote-access/rdp/RDPCredentialsModal.tsx
  • src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts
  • src/modules/remote-access/rdp/useRemoteDesktop.ts

Comment thread src/modules/remote-access/rdp/ironrdp-wasm-bridge.ts
Comment thread src/modules/remote-access/rdp/useRemoteDesktop.ts Outdated
@lixmal

lixmal commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Note: this needs the ironrdp release v0.0.2 which is not yet there

@lixmal
lixmal merged commit 9694bb7 into main Jul 15, 2026
8 of 9 checks passed
@lixmal
lixmal deleted the ship/rdp-linux-slowpath branch July 15, 2026 10:29
ocoj pushed a commit to ocoj/dashboard that referenced this pull request Jul 17, 2026
ocoj added a commit to ocoj/dashboard that referenced this pull request Jul 17, 2026
…tbirdio#717 并汉化

- merge netbirdio/main: Agent Network clusters/RDP/features 更新
- 新增 14 个翻译 key (配置页/Agent Network 通知/RDP 弹窗)
- agent-network/configuration page 全面汉化
- RDPCredentialsModal 全面汉化
- NetBirdCloudProvider toast 汉化
ocoj added a commit to ocoj/dashboard that referenced this pull request Jul 17, 2026
…tbirdio#717 并汉化

- merge netbirdio/main: Agent Network clusters/RDP/features 更新
- 新增 14 个翻译 key (配置页/Agent Network 通知/RDP 弹窗)
- agent-network/configuration page 全面汉化
- RDPCredentialsModal 全面汉化
- NetBirdCloudProvider toast 汉化
@coderabbitai coderabbitai Bot mentioned this pull request Jul 30, 2026
3 tasks
ocoj pushed a commit to ocoj/dashboard that referenced this pull request Aug 16, 2026
ocoj added a commit to ocoj/dashboard that referenced this pull request Aug 16, 2026
…tbirdio#717 并汉化

- merge netbirdio/main: Agent Network clusters/RDP/features 更新
- 新增 14 个翻译 key (配置页/Agent Network 通知/RDP 弹窗)
- agent-network/configuration page 全面汉化
- RDPCredentialsModal 全面汉化
- NetBirdCloudProvider toast 汉化
ocoj added a commit to ocoj/dashboard that referenced this pull request Aug 16, 2026
…tbirdio#717 并汉化

- merge netbirdio/main: Agent Network clusters/RDP/features 更新
- 新增 14 个翻译 key (配置页/Agent Network 通知/RDP 弹窗)
- agent-network/configuration page 全面汉化
- RDPCredentialsModal 全面汉化
- NetBirdCloudProvider toast 汉化
ocoj added a commit to ocoj/dashboard that referenced this pull request Aug 16, 2026
…tbirdio#717 并汉化

- merge netbirdio/main: Agent Network clusters/RDP/features 更新
- 新增 14 个翻译 key (配置页/Agent Network 通知/RDP 弹窗)
- agent-network/configuration page 全面汉化
- RDPCredentialsModal 全面汉化
- NetBirdCloudProvider toast 汉化
ocoj added a commit to ocoj/dashboard that referenced this pull request Aug 16, 2026
…tbirdio#717 并汉化

- merge netbirdio/main: Agent Network clusters/RDP/features 更新
- 新增 14 个翻译 key (配置页/Agent Network 通知/RDP 弹窗)
- agent-network/configuration page 全面汉化
- RDPCredentialsModal 全面汉化
- NetBirdCloudProvider toast 汉化
@coderabbitai coderabbitai Bot mentioned this pull request Aug 16, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDP browser client button not shown for Linux peers running xrdp

2 participants