Bug - Fixed continuationState stuck at PENDING after "Script" button is used in the relay browser

Ensiferum

Member
continuationState stuck at PENDING after "Script" button is used in the relay browser

Since the change in r14732 I have been experiencing this weird behaviour where KoLmafia gets stuck in PENDING state after every relay browser combat in which I've clicked the "Script" button. Once it gets stuck, it doesnt leave "pending" state until something is done in the KoLMafia interface, no matter what you do in the relay browser for combats, non-combats or any other action (inventory use, familiar change, mall search...).

Happens in every build since the one that introduced the change.
 

Ensiferum

Member
What are you having your script button do, exactly? Post your CCS.

The most used CCS is this one, but the issue is present with much simpler CCS as well:
Code:
[ aquabat ]
item crayon shavings, crayon shavings
item Rain-Doh blue balls
attack with weapon

[ aquard ]
scrollwhendone
skill thunder bird
skill curse of weaksauce
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
item Rain-Doh blue balls, Rain-Doh indigo cup
attack with weapon

[ auqadargon ]
scrollwhendone
skill thunder bird
skill curse of weaksauce
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
item Rain-Doh blue balls, Rain-Doh indigo cup
attack with weapon

[ default ]
scrollwhendone
if hascombatitem rock band flyers
    item rock band flyers, Rain-Doh indigo cup
endif
if happymediumglow red
    skill siphon spirits
endif
skill curse of weaksauce
skill saucegeyser
skill saucegeyser
skill saucestorm
skill saucestorm

[ embezzler ]
scrollwhendone
"pickpocket"
skill make it rain
skill disco dance of doom
skill disco dance ii: electric boogaloo
skill disco dance 3: back in the habit
attack with weapon

[ ground floor ]
skill saucegeyser

[ gurgle ]
scrollwhendone
skill thunder bird
skill curse of weaksauce
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
item Rain-Doh blue balls, Rain-Doh indigo cup
attack with weapon

[ orderlies ]
skill thunder clap

[ pirate ]
item Rain-Doh indigo cup, The Big Book of Pirate Insults
skill curse of weaksauce
skill saucegeyser
skill saucestorm
skill saucestorm
skill saucestorm

[ racecar ]
if hascombatitem disposable instant camera
    item disposable instant camera, Rain-Doh indigo cup
endif
skill curse of weaksauce
skill saucegeyser
skill saucestorm
skill saucestorm

[ rain king ]
scrollwhendone
item crayon shavings, crayon shavings
skill thunderstrike
skill shadow noodles
skill thunder bird
skill turtleini

[ soggyraven ]
scrollwhendone
skill thunder bird
skill curse of weaksauce
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
skill thunder bird
item Rain-Doh blue balls, Rain-Doh indigo cup
attack with weapon

[ spurt ]
scrollwhendone
item crayon shavings, crayon shavings
item Rain-Doh blue balls, Rain-Doh indigo cup
skill thunder bird
skill thunder bird
skill thunder bird
skill splashdance
skill thunder bird
attack with weapon

[ windtalker ]
skill transcendent olfaction
skill saucegeyser
 

Ensiferum

Member
Absolutely anything, the script fires properly, combat ends and I can proceed to the next turn with "again" button, while Mafia itself never leaves "pending" state.

Good news is that once again this might be a premature bug report and the possible reason is (as already suggested in chat) some kind of relay script. The bad... I have no idea how to figure out which and will be even more embarrased when I do. ;-)
 

Ensiferum

Member
No adventure-related scripts and no fight.ash for sure.

I just deleted everything from the /relay folder, turned off health restoring between adventures, turned off mood - still getting stuck at Pending. :confused:
 

roippi

Developer
Download a vanilla copy of mafia to a folder somewhere and see if you can reproduce it there.
 

xKiv

Active member
Are you sure it's actually mafia in PENDING state? Could it be just a display issue with the window not updating when you switch to it (which is a condition I learned to live with, and assume is caused by configuration of my window manager)?
 

roippi

Developer
continuationState and displayState are actually distinct things, yes - and really it's just the latter that's being messed up here. Still, relay threads shouldn't be able to interact with displayState either so there's presumably something to fix.
 

Ensiferum

Member
Happens in a vanilla mafia in brand new folder as well, even with the default CCS.
Code:
[ default ]
special action
attack with weapon

As for if it's displayState - nothing is available to interact with in the Mafia window unless i press Esc or something else that'd make the window refresh.
 

roippi

Developer
Well, I can't reproduce, sorry. I guess you can open up a DEBUG log and run a combat in your vanilla copy, see if there's anything noteworthy in there.
 

Ensiferum

Member
I dont think there's anything different in the debug log than usual.
 

Attachments

  • DEBUG_20140929.txt
    148.3 KB · Views: 20

Ensiferum

Member
A few quotes from clan chat from few minutes ago:

[20:50] TurtleBomb13: hmm, mafia acting up, brb
[20:53] TurtleBomb13: it stayed grey like it was in the middle of an adv and wouldn't let me access anything
[21:13] TurtleBomb13: yes i used the script button in the browser and it froze mafia
[21:13] TurtleBomb13: only happened that once so far

So I am definitely not hallucinating and there's some kind of a problem with that.
 

roippi

Developer
I was never questioning whether you were making it up.

There's some sort of race condition that happens on slower systems that I just don't want to think about debugging. Try r14760?
 

Ensiferum

Member
I know you weren't, I was just getting a bit frustrated with the randomness it appeared with.

14760 looks great for the few turns I've tried it so far. Thanks!
 

Ensiferum

Member
After some more turns it seems that while the original problem in this topic is fixed, there's now a new kind of weirdness with the way Mafia's charpane (displayState?), quite possibly related.

To be more specific, when a combat script fails to win the fight and aborts with the message "You're on your own, partner." the charpane remains green, while it used to become red before.
In the single case where it managed to turn red, it never went back to green after winning the combat.
 

roippi

Developer
To be more specific, when a combat script fails to win the fight and aborts with the message "You're on your own, partner." the charpane remains green, while it used to become red before.

Yes, I know. That's intentional - and probably more correct than the old behavior, anyway. People are welcome to discuss, of course, but the whole point of the continuationState change was to segregate relay behavior from main interface behavior. This is consistent with that.
 

Ensiferum

Member
Ah, okay. Guess I hadn't seen this behaviour while constantly stuck with a grey charpane, so it seemed a bit unusual and thought I'd mention it.
Thanks for sorting the main problem once again.
 
Top