Skip to content

Keep Discord rich presence alive with bounded persistent IPC - #958

Merged
capy-ai[bot] merged 3 commits into
devfrom
capy/keep-discord-rich-presence
Sep 16, 2026
Merged

capy-ai[bot] merged 3 commits into
devfrom
capy/keep-discord-rich-presence

Conversation

@zortos293

Copy link
Copy Markdown
Collaborator

Changes

Replace one-shot Discord exchanges with one persistent IPC owner. Discord ties presence to the connection, so dropping the socket immediately after SET_ACTIVITY cleared the activity while the signature cache suppressed retries.

Keep a bounded latest-intent mailbox, correlate command replies, require READY, handle PING/CLOSE/EOF, and reconnect with capped backoff. Service drop releases the connection and stops the worker. Preserve legacy RPC timestamp units in seconds.

Use bounded overlapped Windows I/O with heap-owned pending buffers. If cancellation cannot complete, retain the live operation memory safely and disable further IPC for that service instance. This bounds abandoned resources and keeps session callers responsive.

Verification

Independently reviewed the final lifecycle, queue, framing, and Windows code and reran:

  • Full Rust core tests: all passed, including 31 Discord regressions.
  • Core Clippy and diff checks: passed.
  • Windows cross-target check of the exact final Discord module with its required manifest features: passed.

Fake IPC uses real Unix sockets and models connection-bound activity, restarts, fragmented replies, command errors, floods, opt-out, shutdown, and stalled peers. Regressions also cover latest-intent races, terminal-state spins, cancellation completion classification, and buffered-frame deadlines.

The configured application ID was independently checked through Discord's public RPC metadata and resolves to OpenNow.

Limits

No live Discord client was available, so real presence rendering and external-image acceptance remain unverified. The Windows path is compile-checked and tested through injected lifecycle/completion logic, not executed on a Windows host. Full Windows core cross-compilation was unavailable because native dependencies require the Windows build toolchain.

Open in Capy

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2927e7e9-5603-4d30-a004-9056c4e10c51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@capy-ai capy-ai 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.

Capy found 1 potential issue (1 medium).

Open in Capy

Comment thread native/opennow-core/src/discord.rs Outdated
@capy-ai

capy-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Fixed the Windows cancellation finding and the CI formatting failure in c3c14e2f42667558e7d684c93bd791feac901972. Cancellation now gets its own bounded reap window instead of reusing an expired write deadline.

Independent verification on the final source passed: Rust formatting, locked Clippy with warnings denied, the full core test suite, and a Windows cross-target check of the exact Discord module. Windows runtime behavior and live Discord rendering remain unverified. CI is rerunning. The push targeted only refs/heads/capy/keep-discord-rich-presence; dev remains at 7a76b0c965087750d46411901ce8d04ba1b2524a.

@capy-ai
capy-ai Bot merged commit e9c3412 into dev Sep 16, 2026
14 checks passed
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.

1 participant