Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs(feeds): fold the extractTag rationale into its doc comment

Adam Eivy10cab3fd6bdf
diff --git a/server/services/feeds.js b/server/services/feeds.js
index 172b73dc02..fca82c8266 100644
--- a/server/services/feeds.js
+++ b/server/services/feeds.js
@@ -67,12 +67,13 @@ async function ensureItemsSorted() {
// ─── RSS/Atom Parser ────────────────────────────────────────────────────────
/**
- * Extract text content from an XML tag (non-greedy, handles CDATA).
+ * Extract text content from an XML tag (first occurrence, handles CDATA).
+ *
+ * Index scanning rather than a regex: the old `\s*(?:CDATA)?([\s\S]*?)\s*</tag>`
+ * pattern backtracked catastrophically when a fetched feed opened a tag and
+ * never closed it (a 2 KB `<title>` plus spaces took 13 s), and feeds refresh
+ * on a schedule from servers PortOS does not control.
*/
-// Index scanning rather than a regex: the old `\s*(?:CDATA)?([\s\S]*?)\s*</tag>`
-// pattern backtracked catastrophically when a fetched feed opened a tag and
-// never closed it (a 2 KB `<title>` plus spaces took 13 s), and feeds refresh
-// on a schedule from servers PortOS does not control.
const extractTag = (xml, tag) => {
const lower = xml.toLowerCase();
const open = `<${tag.toLowerCase()}`;