Skip to content

fix(core): guard OnLogAction until configs are executed (#41)) - #42

Merged
Rushaway merged 1 commit into
masterfrom
Rushaway-patch-2
Aug 31, 2026
Merged

fix(core): guard OnLogAction until configs are executed (#41))#42
Rushaway merged 1 commit into
masterfrom
Rushaway-patch-2

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Problem

Right after a crash or plugin reload, OnLogAction could fire and log
No webhook found or specified. even though a webhook is configured.

AutoExecConfig() only queues the cfg exec, it doesn't run it synchronously.

SourceMod only guarantees cvar values reflect the config file starting at OnConfigsExecuted. So the cached g_sWebhookURL
(read in OnPluginStart) can still be the compiled-in empty default if an admin action gets logged before the config actually executes.
The AddChangeHook on the webhook cvar fixes the cache eventually, but too late for whatever OnLogAction call already fired in that window.

Fix

Re-sync g_sWebhookURL in OnConfigsExecuted (guaranteed to run after configs are applied).
Add a g_bConfigsExecuted guard: OnLogAction now bails out silently until configs have actually executed, instead of racing the cached webhook URL and spamming LogError.

Notes

No behavior change once the plugin is fully initialized — only affects the narrow startup/reload window.
Bumped version to 1.4.3.
Fixes #41

Copilot AI lite review requested due to automatic review settings August 30, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Rushaway
Rushaway merged commit 4d0c5b6 into master Aug 31, 2026
7 checks passed
@Rushaway
Rushaway deleted the Rushaway-patch-2 branch August 31, 2026 15:09
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.

bug: AdminLogging Webhook Error

2 participants