fix: normalize discord agent newlines on 7.2#2638
Conversation
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)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
🧹 PR Test Plugin Cleaned UpThe 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. |
Summary
Original PR: #2527
Original commit: 309ae17
Root Cause
Discord status reports could pass literal
\n,\r\n, or\rsequences throughDESCRIPTIONandCONTENT, so Discord rendered escaped newline text instead of real line breaks.Validation
bash emhttp/plugins/dynamix/agents/tests/discord_newline_test.sh