Draft not cleared after posting reply #413
Labels
No labels
a11y
Bug
Bug fix
Critical Priority
Documentation
Feature
Feature request
Held for next release cycle
High Priority
Low Priority
Medium Priority
Minor change
Translation/Locale
WIP
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma-fe#413
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Opening this with debugging information because I'm not sure how to fix it yet.
Bisect shows this was regressed by
a7dea2f70f
. I've tracked it down to this change introduced in Vue 3.3.11.Relevant code:
watch: {
'newStatus': {
deep: true,
handler () {
this.statusChanged()
}
clearStatus () {
const newStatus = this.newStatus
this.newStatus = {
status: '',
spoilerText: '',
files: [],
visibility: newStatus.visibility,
contentType: newStatus.contentType,
language: newStatus.language,
poll: {},
mediaDescriptions: {}
}
After
clearStatus
wipes the value ofnewStatus
, the watcher never fires.As far as I can tell, the new behavior is intentional: posting a reply eventually causes the form to be destroyed, so even though the reactive change is likely queued up, it doesn't end up being dispatched.
Workarounds I've attempted:
flush: 'sync'
on the watcher does help, but I don't think it's a good idea since it would prevent rate-limiting while typing?statusChanged()
after settingnewStatus
; this feels kinda hacky? it'd probably be better if there was a way to manually flush the watcher instead...Willing to send a PR, pointers appreciated. 💜
Okay, so it turns out the warning about batching is only relevant for events that happen at the same time, and it won't meaningfully debounce user input (even with fast typing/key mashing I'm seeing the handler fire for every single key press). I'll submit synchronous flush as the correct fix.