airbrake / phpbrake

The official Airbrake PHP error notifier
https://airbrake.io
MIT License
48 stars 36 forks source link

Remote Config failing to load, and setting 'remoteConfig' to false does nothing #120

Open crisps-for-breakfast opened 1 year ago

crisps-for-breakfast commented 1 year ago

About 9 days ago, our airbrake/phpbrake v0.8.0 connection with CodebaseHQ stopped reporting errors; it was working previously

On closer inspection, the remote config is failing to load - "Project not found. Disabled config returned." I'm assuming this is an issue with CodebaseHQ's remote config file disappearing, but it appears to have been hosted on airbrake.io previously

Honesty I'm a bit confused about the whole remote config thing and whether it's even necessary, I wasn't even aware it existed before, so I attempted to turn it off with

new Notifier([
        'host' => 'xxx',
        'projectId' => 'yyy',
        'projectKey' => 'zzz',
        'environment' => 'eee',
        'remoteConfig' => false,
 ]);

but the Notifier constructor contains the lines:

if (empty($opt['remoteConfig'])) {
    $opt['remoteConfig'] = true;
}

which seems to ensure $opt['remoteConfig'] is alwaystrue

This feels like a bug as Notifier::remoteErrorConfig() checks this value when deciding whether to use the RemoteConfig::DEFAULT_CONFIG

I'm going to attempt to downgrade to 0.7.5

crisps-for-breakfast commented 1 year ago

Downgrading to 0.7.5 solves the issue - perhaps I have misunderstood the remote config option

gbirke commented 1 year ago

I also unwittingly used this feature, cause by the empty call. It should use isset instead.