Skip to content

fix(motherlode): recover from logout interruptions#489

Open
JogOnJohn wants to merge 1 commit into
chsami:developmentfrom
JogOnJohn:fix/motherlode-logout-recovery
Open

fix(motherlode): recover from logout interruptions#489
JogOnJohn wants to merge 1 commit into
chsami:developmentfrom
JogOnJohn:fix/motherlode-logout-recovery

Conversation

@JogOnJohn

Copy link
Copy Markdown

Summary

This PR hardens Motherlode Mine against logout/break interruptions so the script does not remain enabled but silently idle after the player logs back in.

It builds on the recent upstream scheduler guard by adding the recovery pieces needed for the observed failure mode:

  • reset transient MLM workflow state after an unhandled main-loop exception
  • gate workflow execution on login, global script pause, thread interruption, local player, and worldView readiness
  • make EMPTY_SACK resumable across scheduled ticks instead of a blocking loop
  • abort/reset in-progress workflows cleanly when logout interrupts sack emptying or related sleeps
  • bump Motherlode Mine to 1.9.7 because upstream already contains 1.9.6

Context

The original issue presented after scheduled BreakHandler logout/login cycles. MLM stayed marked active after login, but produced no further transitions until manually restarted. One captured failure included a null actor/world-view path during logout, and another occurred while the script was in EMPTY_SACK with no explicit MLM exception before it became silent.

Upstream development recently added a broad try/catch around the MLM loop, which prevents the scheduler from dying outright. This PR keeps that direction but adds explicit state reset and lifecycle checks so the next tick starts from a clean, valid runtime state instead of continuing with stale workflow flags.

Test plan

  • Rebased onto latest chsami/Microbot-Hub:development after upstream Motherlode changes and resolved the MLM conflict.
  • Ran targeted build:
./gradlew.bat clean build -PpluginList=MotherloadMinePlugin --console=plain
BUILD SUCCESSFUL in 2m 10s
  • Ran full CI-equivalent Hub build:
./gradlew.bat clean build --console=plain
BUILD SUCCESSFUL in 4m 51s
  • Tested the patched JAR locally through roughly two days of uninterrupted Motherlode Mine runtime.
  • Observed repeated normal MINING, DEPOSIT_HOPPER, EMPTY_SACK, and FIXING_WATERWHEEL transitions.
  • Observed scheduled BreakHandler logout/login cycles without MLM becoming silent or requiring manual restart.

Notes

This is intentionally scoped to the Motherlode Mine plugin. The separate QoL/Wintertodt null-player exceptions seen during logout are not addressed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant