mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 12:50:27 +08:00
The PR status webhook only knows the canonical PR URL, but posts can link the PR in forms the onebox engine also accepts: with a path suffix (/changes, /files), query, fragment, http scheme, or www host. Oneboxes are cached per exact URL (and full oneboxes under the normalized encoding), so invalidating only the canonical URL left every other variant stale. The rebake then re-cooked the old status straight from cache and the icon never updated. Match links with an anchored, scheme/host-tolerant pattern and invalidate the exact URLs stored in TopicLink/Chat::MessageLink (plus their normalized encodings), so whichever variant a post used gets a fresh fetch on rebake. The anchoring also stops a webhook for `/pull/12` from rebaking posts for `/pull/123`, which the old prefix match did. |
||
|---|---|---|
| .. | ||
| create_github_linkback_spec.rb | ||
| rebake_github_pr_posts_spec.rb | ||
| replace_github_non_permalinks_spec.rb | ||