Bug - Fixed autoSatisfyWithStash can crash the application if you're clanless

Irrat

Member
Using a new account, I mindlessly clicked on "autoSatisfyWithStash" in the preferences and the application promptly froze.

Restarting the application had it in an endless loop trying to access the clan stash, until I switched the preference off again.
 

MCroft

Developer
Staff member
I duplicated this.

It wasn't endless, but it did repeat the following 504 times in the console:
Code:
Refreshing stash contents...
Unhandled redirect to clan_signup.php

This code should prevent this, but doesn't:

Rich (BB code):
  public static boolean canUseClanStash() {
    return KoLCharacter.canInteract()
        && Preferences.getBoolean("autoSatisfyWithStash")
        && KoLCharacter.hasClan()
        && !Limitmode.limitClan();
  }

At some point while logging in with a new character, it set hasClan to true.

I am still looking into why.
 

MCroft

Developer
Staff member
new characters have a clan of "", not null. Now it checks for both.

Due to my screw up, it's been committed without review. My apologies to my fellow devs.
 

Ryo_Sangnoir

Developer
Staff member
We've also gained 36 commits which are all "Merge remote-tracking branch 'origin/main'". It might be worth force pushing development back to clean it up, then going in as a PR.
 

MCroft

Developer
Staff member
That sounds like a good idea. I think the PR process would've had "a squash merge" option.

I am not sure why it didn't do what I expected, which was to push to a feature branch I (thought I) created, although maybe what it did was create the feature branch locally and set up origin/main as the remote tracking branch (so push pushed to that).

So, next bit of help, how do I undo my bum checkin? The internet shows me 23 different options and doesn't help me understand which set of steps are preferred.

Feels like knowing that would help.
 

Ryo_Sangnoir

Developer
Staff member
We now have some branches built on top of main-as-it-is, so rebasing the commits will probably do more harm than good. This thing is only really a good idea if either nobody else is working on the branch, or you manage to do it quickly (or everybody can agree to not do anything until it's done).

The quickest way to undo a commit is to find the last known-good commit and force push it over main. In this case, this would be 71cae76f3a4b3fbe0564aaa152401fccca98552b (which you can see in https://github.com/kolmafia/kolmafia/commits/main).

From there, you take the main you pushed (5af85ddb753b88895520f90f49394256037f369a), and push it to a separate branch and file a PR, and then squash merge it in as usual.
 

heeheehee

Developer
Staff member
Ehh. Rewriting history is messy. If someone's already pulled the latest version (e.g. ci.kolmafia.us), that'll require manual resolution to fix.
 
Top