WorldTools icon indicating copy to clipboard operation
WorldTools copied to clipboard

fix: clear progress bossbar after drain completes

Open terbin opened this issue 6 months ago • 0 comments

BarManager.progressBar() returns the bossbar widget whenever StorageFlow.lastStored is non-null. The decay-and-clear path lives in BarManager.updateCapture(), which only runs while capturing is true. After the drain finishes (capturing flips to false), the bossbar persists at whatever fill it last had until the next capture starts.

The symptom is most visible when the drain spans a server change: disconnect mid-drain, reconnect to another server, then the stale bossbar from the previous server's capture lingers on the new server's HUD when the drain completes.

Clear lastStored in StorageFlow's cleanup block so progressBar() returns empty as soon as the drain ends.

With the bossbar gone, the existing catch (e: Throwable) at the bottom of StorageFlow.launch became the sole place an unexpected drain failure could surface, and it only logged. Add a MessageManager.sendError on the same path so a user without log access still sees the failure, mirroring the existing sendError on the IOException and SymlinkValidationException catches above it.

Verification

Bossbar widget cleared at drain end, verified across a server-change scenario (disconnect mid-drain, reconnect to a different server, drain finishes; HUD now empty instead of carrying a stale fill).

terbin avatar May 19 '26 01:05 terbin