DeepSeek V4 Pro · Heavy
feature-can-edit-category-host-relationships-for-embedding-discourse-cursor
Discourse · Ruby · M · 100–299 lines · 6 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Opus 5.5.
- Gold bugs found
- 3 of 10
- Comments published
- 6
- Comments matching a bug
- 3
- Comments not matching
- 3
- Cost of this PR
- $1.611
Published comments (6)
embedding.embeddable_hosts is a plain array, so pushObject/removeObject fail — The hydrated collection is a plain array, so mutating it with Ember methods throws a TypeError and leaves the UI broken. Wrap it with `Ember.A(...)` in `_hydrateEmbedded`, or use plain `push`/`filter` here.
CreateEmbeddableHosts migration crashes when embed_category is unset — When `embed_category` is unset, the inner join returns no rows and indexing nil raises, skipping the intended fallback. Check `ntuples` before indexing so unset values fall back to the uncategorized category.
Migrated embeddable_hosts URLs are not normalized before insertion — Raw SQL inserts bypass `before_validation`, so URL-form hosts keep schemes and paths that never match `uri.host`. Normalize each host before inserting, or insert through the model so validation runs.
Obsolete example no longer verifies embeddable_host blank condition — The expectation now passes only because `embed_truncate` defaults to false, so it no longer tests the embeddable-host condition. Remove the example or set `SiteSetting.embed_truncate = true` and stub `has_topic_embed?` to return true.
EmbeddableHostsController update/destroy dereferences nil for missing id — A stale or double delete returns nil from `where(...).first`, which raises NoMethodError and a 500. Use `EmbeddableHost.find(params[:id])` to render a 404, or return early when nil.
Unconditional sub! on nil host raises NoMethodError — A nil host raises NoMethodError during `before_validation`, bypassing the intended format validation and producing a 500. Normalize `self.host` to an empty string before calling `sub!`.