File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ func NewConfigHandler(options Options) *ConfigHandler {
111111 if ! shouldRefetch (evt .New , evt .Old ) {
112112 return
113113 }
114+ slog .Debug ("User change detected that requires config refetch" )
114115 if err := ch .fetchConfig (); err != nil {
115116 slog .Error ("Failed to fetch config" , "error" , err )
116117 }
@@ -121,9 +122,8 @@ func NewConfigHandler(options Options) *ConfigHandler {
121122
122123// shouldRefetch determines whether a config refetch is needed based on user ID and account type changes.
123124func shouldRefetch (new , old common.UserInfo ) bool {
124- return new != old &&
125- (new == nil || old == nil || // sanity check
126- new .LegacyToken () != old .LegacyToken () || // user ID changed
125+ return new != nil && old != nil && old .LegacyID () != 0 &&
126+ (new .LegacyToken () != old .LegacyToken () || // user ID changed
127127 new .AccountType () != old .AccountType ()) // changed between free and pro
128128}
129129
@@ -170,7 +170,6 @@ func (ch *ConfigHandler) fetchConfig() error {
170170 if ch .isClosed () {
171171 return fmt .Errorf ("config handler is closed" )
172172 }
173- slog .Debug ("Fetching config" )
174173 var preferred C.ServerLocation
175174 oldConfig , err := ch .GetConfig ()
176175 if err != nil {
You can’t perform that action at this time.
0 commit comments