You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2.x] fix(api): surface event posts in discussion PATCH responses and route title via rename() (#4658)
* [2.x] fix(api): surface event posts in discussion PATCH responses and route title via rename()
Fixes two related 2.x regressions where discussion changes silently
fail to surface in the UI:
1. Event posts created via `mergePost()` (sticky/tags/lock) were absent
from PATCH responses. The 1.x `UpdateDiscussionController` refreshed
the `posts` linkage and inlined modified posts on every update; the
2.x `DiscussionResource` rewrite dropped that.
2. Renaming a discussion no longer raised `Renamed`. The 2.x
`DiscussionResource` title field delegated to the default attribute
setter, bypassing `Discussion::rename()`. The
`DiscussionRenamedLogger` listener never ran, so neither the
`discussionRenamed` event post nor the notification fired.
Together these broke the "rename -> event post appears -> author gets
notified" flow that worked end-to-end in 1.x.
Core fixes:
- `DiscussionResource::posts` field now exposes linkage on update
- `DiscussionResource::title` field now routes through `rename()`
- `RenameDiscussionModal` chains redraw onto the `update()` promise
Sticky/Tags/Lock JS:
- Chain redraw onto the `stream.update()` promise (was firing
synchronously, before the new post was in-store)
Sticky/Tags realtime:
- Register broadcasts via the Realtime extender so other users see
the event posts as they happen, mirroring the existing `lock`
template. Recipient permission is enforced per-user by the Realtime
Generator (internal API request runs as the recipient).
Closes#4620
* [2.x] chore(ts): map ext:flarum/realtime/* path in sticky and tags tsconfig
build-typings was failing because the new `extendRealtime.ts` files
import from `ext:flarum/realtime/forum/extenders/Realtime`, but
neither extension's tsconfig.json mapped that module specifier to
realtime's dist-typings. Mirror the mapping that flarum-lock already
has.
0 commit comments