Skip to content

Webhook Issues Following Force Shutdown #3

@cameron-b63

Description

@cameron-b63

Webhook Issues Following Force Shutdown

After a forced shutdown, the Discord webhook will not post messages without some finagling and plenty of restarting. Macro logs show successful event detection and even 200s on POST requests, but still no messages in the Discord channel. I discovered this following a power outage.

Reproduction

I can consistently reproduce the issue by:

  1. Opening the Roblox Player in my Sols RNG private server;
  2. Starting the biome macro;
  3. Waiting for a successful webhook message to come through;
  4. Forcefully shutting down the PC.

After restart, the macro appears to be working but there are no messages coming through the discord; additionally, the webhook does not send a "macro stopped" message on force shutdown.

Current State of Recovery

Currently, I can successfully get the macro working again by:

  1. Opening the Roblox Player in my Sols RNG private server;
  2. Starting the biome macro;
  3. Waiting for a biome change which should trigger the webhook;
  4. Closing the Roblox Player;
  5. Stopping the Biome Macro;
  6. Waiting for at least 5 minutes;
  7. Opening the Biome Macro;
  8. Waiting for at least 1 minute;
  9. Opening the Roblox Player.

Sometimes, I must repeat the process more than once.

Suggested Fix

I took a look around, and it seems to me that the correct approach is to use a signal handler so that shutdown still attempts to gracefully close the webhook. My theory is that the desync stems from Discord, not necessarily from the biome macro, so we at least need to try to get that web request out during WM_QUERYENDSESSION or WM_ENDSESSION (the latter taking place during a less graceful shutdown iirc).

I will open a PR if I find time in the coming days.

Potential Issues

Signal handlers are infamous for cross-platform compatibility issues. This doesn't appear to be a problem right now, but you may experience different incarnations of this issue if you decide to support more devices in the future.

Device Info

Edition Windows 11 Education
Version 25H2
Installed on ‎5/‎21/‎2025
OS build 26200.8457
Experience Windows Feature Experience Pack 1000.26100.304.0

Processor AMD Ryzen 7 3700X 8-Core Processor (3.59 GHz)
Installed RAM 32.0 GB (31.9 GB usable)
Device ID 98BB3A6A-1EFE-4987-B96C-DF84050373C9
Product ID 00328-20090-00000-AA974
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions