Canapin
(Coin-coin le Canapin)
12월 15, 2024, 7:49오후
1
매우 사소한 버그이며, 일종의 엣지 케이스이지만 웹사이트를 관리하면서 404 에러를 마주하게 되면 “내가 뭔가 잘못했나?” 하는 불안감이 드는 것은 당연합니다.
같은 화면에서 태그 이름을 변경했다가 이전 태그 이름으로 되돌리는 경우(페이지를 새로 고치지 않는 경우) 404 오류가 발생합니다.
태그 이름을 최소 한 번 변경한 후, 같은 화면에서 이전에 확인한(또는 원래 이름이었던) 태그 이름으로 되돌리면, Discourse가 사용되지 않는 tag_name을 사용하여 잘못된 /tag/<tag_name>/notifications 라우트를 요청하게 되어 404 오류가 발생합니다.
재현 방법:
기존 태그 페이지를 엽니다: https://your-discourse.com/tag/a
렌치 아이콘을 클릭하고 이름을 변경한 후 확인( )을 누릅니다.
(선택 사항) 이름을 다시 변경합니다.
이름을 이전 이름 중 하나로(또는 원래 태그 이름으로) 되돌립니다.
2개의 좋아요
martin
(Martin Brennan)
1월 29, 2025, 2:36오전
6
상세한 보고 감사합니다. 이제 이 문제를 수정할 패치가 준비되었고 곧 머지될 예정입니다:
main ← fix/tag-rename-404
merged 12:06AM - 30 Jan 25 UTC
Changing a tag name and reverting it to a previous tag name choice on
the same … screen (meaning, without reloading the page) causes a 404
error.
Reproduction steps:
* Open an existing tag page https://your-discourse.com/tag/a
* Click the wrench, change the name and save
* Open edit again, revert the name to the original tag name
* 404 error
This was happening because of the way we find existing objects
in our store. Tags are using the name as the id/primary key
unlike other records in the UI. When we get the existing object
from the store we throw away the "new" ID, so we ended up with
the old tag ID on the existing object, which led to a 404. To
fix it we can just manually set the tag ID to what it is supposed
to be from params in the tag show route.
c.f. https://meta.discourse.org/t/404-error-when-you-revert-a-tag-name-after-changing-it-without-reloading-the-page/342559
3개의 좋아요