GPT-6.1 Sol · Balanced
feature-can-edit-category-host-relationships-for-embedding-discourse-cursor
Discourse · Ruby · M · 100–299 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 2 of 4
- Comments published
- 4
- Comments matching a bug
- 2
- Comments not matching
- 2
- Cost of this PR
- $0.721
Published comments (4)
Empty embed category lookup aborts migration before fallback — Installations with an empty `embed_category` setting abort the migration because `execute(...)[0]['id']` accesses a missing result. Check for an empty result before reading `['id']` so the uncategorized fallback can run.
Migrated hosts retain schemes and paths that prevent host matching — Previously allowed hosts stop working after upgrade because `EmbeddableHost.record_for_host` compares hostnames against migrated `h` values that may retain schemes or paths. Strip schemes and paths from `h` before inserting, matching the normalization in `app/models/embeddable_host.rb`.
Host validation rejects valid top-level domains longer than five letters — Valid hosts such as `example.technology` can no longer be added or edited because `validates_format_of :host` caps top-level domains at five letters. Remove the upper length limit.
Uppercase URL hostnames fail to match allowed embedding hosts — URLs with uppercase hostnames are denied during embedding authorization and topic retrieval because `where` lowercases only the stored value. Lowercase `host` before binding it to the query.