mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-22 04:21:32 +02:00
fix(core): Insights page shows license paywall for licensed users (backport to release-candidate/2.23.x) (#31452)
Co-authored-by: Konstantin Tieber <46342664+konstantintieber@users.noreply.github.com>
This commit is contained in:
parent
e3678bc7ae
commit
dabd397fb3
|
|
@ -27,7 +27,7 @@
|
|||
return u.toString(1) + '.people (stub)';
|
||||
},
|
||||
o =
|
||||
'capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled getFeatureFlag onFeatureFlags reloadFeatureFlags'.split(
|
||||
'capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled getFeatureFlag onFeatureFlags reloadFeatureFlags group'.split(
|
||||
' ',
|
||||
),
|
||||
n = 0;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { useSettingsStore } from '@/app/stores/settings.store';
|
|||
import { useSourceControlStore } from '@/features/integrations/sourceControl.ee/sourceControl.store';
|
||||
import { useSSOStore } from '@/features/settings/sso/sso.store';
|
||||
import { useUsersStore } from '@/features/settings/users/users.store';
|
||||
import { usePostHog } from '@/app/stores/posthog.store';
|
||||
import { useVersionsStore } from '@/app/stores/versions.store';
|
||||
import { useBannersStore } from '@/features/shared/banners/banners.store';
|
||||
import type { Cloud, CurrentUserResponse } from '@n8n/rest-api-client';
|
||||
|
|
@ -190,6 +191,21 @@ describe('Init', () => {
|
|||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('should still call getModuleSettings if postHogStore.init throws', async () => {
|
||||
const postHogStore = mockedStore(usePostHog);
|
||||
vi.spyOn(postHogStore, 'init').mockImplementation(() => {
|
||||
throw new Error('PostHog init failed');
|
||||
});
|
||||
|
||||
usersStore.registerLoginHook.mockImplementation(async (hook) => {
|
||||
await hook(mock<CurrentUserResponse>({ id: 'userId', role: 'global:member' }));
|
||||
});
|
||||
|
||||
await initializeCore();
|
||||
|
||||
expect(settingsStore.getModuleSettings).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('initializeAuthenticatedFeatures()', () => {
|
||||
|
|
|
|||
|
|
@ -265,7 +265,12 @@ function registerAuthenticationHooks() {
|
|||
userId: user.id,
|
||||
userRole: user.role,
|
||||
});
|
||||
postHogStore.init(user.featureFlags);
|
||||
try {
|
||||
postHogStore.init(user.featureFlags);
|
||||
} catch (e) {
|
||||
// don't let posthog failing prevent further function calls
|
||||
console.error(e);
|
||||
}
|
||||
npsSurveyStore.setupNpsSurveyOnLogin(user.id, user.settings);
|
||||
await settingsStore.getModuleSettings();
|
||||
void bannersStore.loadDynamicBanners();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user