From bafcedcd559138431f377e3bbc38380f041111c2 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Wed, 12 Aug 2026 09:08:03 +0200 Subject: [PATCH 1/2] fix: prevent NOT NULL crash when Jira epic has no priority upsert_epic (the per-sync path run on every JiraSyncJob tick) set priority to priority_int(...) with no fallback. epics.priority is NOT NULL default 0, so an epic that loses its Jira priority field would raise on every sync tick, matching the fallback already used in discover_closed_epics!. Signed-off-by: Kai Wagner --- app/services/jira_sync.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/jira_sync.rb b/app/services/jira_sync.rb index d68c9bb..0f8ceb1 100644 --- a/app/services/jira_sync.rb +++ b/app/services/jira_sync.rb @@ -220,7 +220,7 @@ def upsert_epic(je, now) epic.assign_attributes( name: je.fields["summary"], jira_status: je.fields.dig("status", "name"), - priority: priority_int(je.fields["priority"]), + priority: priority_int(je.fields["priority"]) || 0, raw_fields: je.fields, last_seen_in_query_at: now, removed_at: nil From 32b749a0a864c7ef3a5aa86b047ab5cb194a8889 Mon Sep 17 00:00:00 2001 From: Kai Wagner Date: Wed, 12 Aug 2026 09:08:03 +0200 Subject: [PATCH 2/2] fix: infinite loop rendering description with non-breaking space jira_wiki_to_html's blank-line check used line.strip.empty?, which does not strip U+00A0. A line containing only a non-breaking space (seen in a real Jira ticket description) fell through to the paragraph branch, whose continuation loop uses Rails' .present? and correctly treats it as blank -- so the loop consumed zero lines and never advanced, spinning the request thread at ~100% CPU forever. Switched to line.blank? so both checks agree on what counts as blank. Signed-off-by: Kai Wagner --- app/models/issue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index d714a2b..1d27e72 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -91,7 +91,7 @@ def jira_wiki_to_html(text) i += 1 end out << "" - elsif line.strip.empty? + elsif line.blank? i += 1 else para = []