Button does not reappear after respawning

Users complain that the button disappears after you die.

It's supposed to disappear when you die, but then reappear when you spawn. Does your server use conventional spawning behavior where players spawn asleep and then have to wake up, or do you have a modded experience where there is no sleeping? I ask because they use different hooks. Either way, this should not be an issue in the latest version of the plugin.

We use the standard behavior, haven't changed it.

I just tested and was unable to reproduce this issue. I set the default button position to "", ran the backpackui right command, then I suicided many times. Every time I respawned and woke up, the button reappeared. I also tried with the default config and got the same result. If you want me to try with your config, share your config.

Do you know if this is consistent behavior, meaning it happens on every death, or only some deaths? If only some deaths, any info you can provide about how/where/when the player died may be useful to narrow down the precise circumstances that cause this.

Here is my config (is this the best way to share?). I asked my players and they said it happens consistently when they die and it seems to be everyone.

{
  "Commands": [
    "backpackui",
    "backpackbutton"
  ],
  "Background": {
    "Enabled": true,
    "Color": "0.969 0.922 0.882 0.035",
    "Sprite": "assets/content/ui/ui.background.tiletex.psd"
  },
  "Gather mode indicator": {
    "Enabled": true,
    "Color": "0.4 0.8 1 1"
  },
  "Retrieve mode indicator": {
    "Enabled": true,
    "Color": "0.4 0.8 1 1"
  },
  "Occupied & total slots": {
    "Show occupied slots": false,
    "Show total slots": false,
    "Offset min": "0 -18",
    "Offset max": "60 0",
    "Text align": "MiddleCenter",
    "Default color": "0.4 0.8 0.4 1",
    "Enable dynamic color": true,
    "Dynamic color by fullness percent": {
      "70": "0.8 0.8 0.2 1",
      "80": "0.8 0.4 0.2 1",
      "90": "0.8 0.2 0.2 1"
    }
  },
  "Fill bar": {
    "Enabled": true,
    "Width": 4.0,
    "Sprite": "assets/content/ui/ui.background.tiletex.psd",
    "Default color": "0.4 0.8 0.4 1",
    "Enable dynamic color": true,
    "Dynamic color by fullness percent": {
      "70": "0.8 0.8 0.2 1",
      "80": "0.8 0.4 0.2 1",
      "90": "0.8 0.2 0.2 1"
    }
  },
  "Default button position": "Left",
  "Button positions": [
    {
      "Name": "Left",
      "Enabled": true,
      "Offset X": -263.5,
      "URL": "https://imgur.com/ADm4SIu.png",
      "Skin ID": 0,
      "Image size": 56.0
    },
    {
      "Name": "Right",
      "Enabled": false,
      "Offset X": 185.0,
      "URL": "https://imgur.com/ADm4SIu.png",
      "Skin ID": 0,
      "Image size": 56.0
    }
  ]
}

Yes, inline is a good way to share the config, as it allows me to read it without opening other links, and I can easily copy/paste it into my config.

I just tested with your config and I'm still unable to reproduce the issue. I also cleared the data file as part of that test just in case. I tried respawning using a bed, as well as respawning on the beach. Respawned many times. All the same result.

Looking at the code, there's one possibility that comes to mind. The OnPlayerSleepEnded hook only gets subscribed by the plugin if the Backpacks plugin was loaded and the correct version.

private void OnServerInitialized()
{
    if (Backpacks == null)
    {
        LogError($"Backpacks is not loaded. Get it at https://umod.org.");
        return;
    }

    if (!VerifyBackpacksVersion())
        return;

    HandleBackpacksLoaded();

    timer.Every(900, _data.SaveIfChanged);

    Subscribe(nameof(OnPlayerSleep));
    Subscribe(nameof(OnPlayerSleepEnded));
}

What could happen is that Backpack Button loaded first, while Backpacks was not loaded (or was not up to date). Next, the correct version of Backpacks loaded, but Backpack Button did not subscribe to the hook originally... so every time you respawn and wake up, the button would not appear. In fact, I just tested and was able to recreate that problem. You should be able to resolve that by reloading Backpack Button, and this issue shouldn't recur unless there is an issue with Backpacks failing to load in the future. I'll also make a fix in the next update.

I think the following thread may have been describing the same issue, since the Rust update a few weeks ago caused Backpacks to fail to compile, so people who updated it late would have this issue.
https://umod.org/community/backpacks/47619-gui-turns-off-after-death