Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Initialise authProviders array in Go code#63099

Merged
pjlast merged 3 commits into
mainfrom
pjlast/fix-modal-no-auth-providers
Jun 5, 2024
Merged

Initialise authProviders array in Go code#63099
pjlast merged 3 commits into
mainfrom
pjlast/fix-modal-no-auth-providers

Conversation

@pjlast

@pjlast pjlast commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

When a Sourcegraph license is expired or revoked and the instance reverts to free license, then authz (for permissions syncing) stops working as well. This means that there are no AuthProviders set up and the front-end code has null for these values.

The issue arrises from unitialised arrays in Go being marshalled as null instead of []. This PR initialises the array explicitly, instead of relying on the empty value.

Test plan

Tested locally with a revoked license.

Changelog

@cla-bot cla-bot Bot added the cla-signed label Jun 5, 2024
@github-actions github-actions Bot added team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all labels Jun 5, 2024
@pjlast pjlast requested a review from eseliger June 5, 2024 14:34
@pjlast pjlast changed the title Check for null on AuthProviders for accounts connection modal Initialise authProviders array in Go code Jun 5, 2024
Comment thread cmd/frontend/internal/app/jscontext/jscontext.go Outdated
@pjlast pjlast enabled auto-merge (squash) June 5, 2024 14:52
@pjlast pjlast merged commit 5749db8 into main Jun 5, 2024
@pjlast pjlast deleted the pjlast/fix-modal-no-auth-providers branch June 5, 2024 14:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants