Skip to content

fix: normalize discord agent newlines on 7.2#2638

Merged
limetech merged 1 commit into
7.2from
codex/7.2-discord-newlines
May 14, 2026
Merged

fix: normalize discord agent newlines on 7.2#2638
limetech merged 1 commit into
7.2from
codex/7.2-discord-newlines

Conversation

@elibosley
Copy link
Copy Markdown
Member

Summary

  • Backport Discord notification newline normalization from 7.3 to 7.2.
  • Preserve Pujit Mehrotra as the original commit author.
  • Include the upstream regression test for Discord payload newline rendering.

Original PR: #2527
Original commit: 309ae17

Root Cause

Discord status reports could pass literal \n, \r\n, or \r sequences through DESCRIPTION and CONTENT, so Discord rendered escaped newline text instead of real line breaks.

Validation

  • bash emhttp/plugins/dynamix/agents/tests/discord_newline_test.sh

Purpose:
- Backport the Discord notification newline normalization from 7.3 to 7.2.
- Keep Pujit Mehrotra credited as the original author of the fix.

Before:
- Discord status report payloads kept literal \n, \r\n, and \r sequences in DESCRIPTION and CONTENT values.

Why that was a problem:
- Multi-line Discord reports rendered escaped newline text instead of real line breaks.

What the new change accomplishes:
- Converts literal newline escape sequences before the Discord payload is generated.
- Adds a regression test that verifies generated Discord field text contains real line breaks.

How it works:
- Normalizes DESCRIPTION and CONTENT shell variables before link handling and payload construction.
- Extracts the Discord agent CDATA into a temporary script and stubs curl/date for deterministic test assertions.

Original PR: #2527

(cherry picked from commit 309ae17)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9d794d0e-685f-4159-8641-d17aa0b33f4c

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/7.2-discord-newlines

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

@github-actions
Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.05.13.2113
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2638/webgui-pr-2638.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix/agents/Discord.xml
emhttp/plugins/dynamix/agents/tests/discord_newline_test.sh

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2638, or run:

plugin remove webgui-pr-2638

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@elibosley elibosley requested a review from limetech May 13, 2026 21:15
@elibosley elibosley added the 7.2 label May 13, 2026
@elibosley elibosley marked this pull request as ready for review May 13, 2026 21:17
Copy link
Copy Markdown
Contributor

@limetech limetech left a comment

Choose a reason for hiding this comment

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

LGTM

@limetech limetech merged commit f4dfa05 into 7.2 May 14, 2026
5 checks passed
@limetech limetech deleted the codex/7.2-discord-newlines branch May 14, 2026 21:23
@github-actions
Copy link
Copy Markdown

🧹 PR Test Plugin Cleaned Up

The test plugin and associated files for this PR have been removed from the preview environment.


🤖 This comment is automatically generated when a PR is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants