Skip to content

Commit 7d0bc74

Browse files
authored
Fixing logs on the failed GQL queries for refreshConfigFeatures (#3117)
Solves the issue https://github.com/sourcegraph/sourcegraph/issues/60050 Basically we already wanted to make sure that GQL and fetch errors aren't something that hammer the logs console so this PR adds an extra case of checking that the error message doesn't have the string that gets repeatedly printed in this users console. ## Test plan <!-- Required. See https://sourcegraph.com/docs/dev/background-information/testing_principles. --> I didn't thoroughly test this PR in the sense that going back to v5.2.0 and then testing. I did go to that version but doing the setup on my local instance caused other issues for me so I left it. My understanding is that this issue is just about seeing something non necessary in the logs so its not really an actually problematic issue.
1 parent d8bb720 commit 7d0bc74

File tree

1 file changed

+4
-2
lines changed
  • lib/shared/src/sourcegraph-api/graphql

1 file changed

+4
-2
lines changed

lib/shared/src/sourcegraph-api/graphql/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,10 @@ export class ConfigFeaturesSingleton {
869869
private refreshConfigFeatures(): void {
870870
const previousConfigFeatures = this.configFeatures
871871
this.configFeatures = this.fetchConfigFeatures().catch((error: Error) => {
872-
// Ignore a fetcherror as older SG instances will always face this because their GQL is outdated
873-
if (!error.message.includes('FetchError')) {
872+
// Ignore fetcherrors as older SG instances will always face this because their GQL is outdated
873+
if (
874+
!(error.message.includes('FetchError') || error.message.includes('Cannot query field'))
875+
) {
874876
logError('ConfigFeaturesSingleton', 'refreshConfigFeatures', error.message)
875877
}
876878
// In case of an error, return previously fetched value

0 commit comments

Comments
 (0)