post_status_form: enable sync flush for watcher #414

Merged
floatingghost merged 1 commit from novenary/akkoma-fe:sticky-drafts into develop 2025-01-05 15:52:26 +00:00
Contributor

This fixes drafts not clearing after posting a reply.

Vue 3.3.11 changed watchers to stop firing after component unmount.
After posting a reply, the post form is removed, now causing the queued event to be discarded.
Synchronous flush causes the handler to be called immediately when changes happen, solving the problem.

See: https://github.com/vuejs/core/pull/7181
See: 80e2128d52
Fixes: a7dea2f70f
Fixes: #413

This fixes drafts not clearing after posting a reply. Vue 3.3.11 changed watchers to stop firing after component unmount. After posting a reply, the post form is removed, now causing the queued event to be discarded. Synchronous flush causes the handler to be called immediately when changes happen, solving the problem. See: https://github.com/vuejs/core/pull/7181 See: https://github.com/vuejs/docs/commit/80e2128d52603856a26a8bb7258606cfe80561e9 Fixes: a7dea2f70f2beba781068a7ff7d8a2a9ef8a9478 Fixes: #413
novenary added 1 commit 2024-09-16 19:54:57 +00:00
post_status_form: enable sync flush for watcher
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
13383982bc
This fixes drafts not clearing after posting a reply.

Vue 3.3.11 changed watchers to stop firing after component unmount.
After posting a reply, the post form is removed, now causing the queued
event to be discarded.
Synchronous flush causes the handler to be called immediately when
changes happen, solving the problem.

See: https://github.com/vuejs/core/pull/7181
See: 80e2128d52
Fixes: a7dea2f70f
Fixes: #413
Member

Can confirm the issue and that this fix works.

Vue doc’s warning about perf implications warrants some attention though. Iirc you already tested individual keystrokes never got batched to begin with off-site, but how does flush: "sync" affect performance of pasted text compared to before the dep upgrade? Is there still only one update for the watcher to process, did it already trigger one update per character before, or does the event count explode with this? If all is fine, ideally document the findings in the commit message

Can confirm the issue and that this fix works. Vue doc’s warning about perf implications warrants some attention though. Iirc you already tested individual keystrokes never got batched to begin with off-site, but how does `flush: "sync"` affect performance of pasted text compared to before the dep upgrade? Is there still only one update for the watcher to process, did it already trigger one update per character before, or does the event count explode with this? If all is fine, ideally document the findings in the commit message
Author
Contributor

As far as I can tell, pasting is atomic (produces a single event) which makes intuitive sense to me.

As far as I can tell, pasting is atomic (produces a single event) which makes intuitive sense to me.
novenary force-pushed sticky-drafts from 13383982bc to ef242a1ddd 2024-10-14 21:18:38 +00:00 Compare
Author
Contributor

Updated the commit message accordingly. I think it wouldn't be a bad idea to add debouncing.

Updated the commit message accordingly. I think it wouldn't be a bad idea to add debouncing.
Oneric approved these changes 2024-10-14 21:42:01 +00:00
Oneric left a comment
Member

seems all good then; thanks for tracking this down!

seems all good then; thanks for tracking this down!
floatingghost merged commit d3fa5cfad0 into develop 2025-01-05 15:52:26 +00:00
floatingghost deleted branch sticky-drafts 2025-01-05 15:52:27 +00:00
Sign in to join this conversation.
No description provided.