Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Refactor decide loading #1596

Merged
merged 14 commits into from
Dec 13, 2024
1 change: 1 addition & 0 deletions cypress/e2e/capture.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ describe('Event capture', () => {
token: 'test_token',
distinct_id: 'new-id',
person_properties: {},
$anon_distinct_id: payload.$anon_distinct_id,
groups: {
company: 'id:5',
playlist: 'id:77',
Expand Down
2 changes: 1 addition & 1 deletion functional_tests/feature-flags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe('FunctionalTests / Feature Flags', () => {
expect(getRequests(token)['/decide/']).toEqual([
// This is the initial call to the decide endpoint on PostHog init, with all info added from `loaded`.
{
// $anon_distinct_id: 'anon-id', // no anonymous ID is sent because this was overridden on load
$anon_distinct_id: 'anon-id',
benjackwhite marked this conversation as resolved.
Show resolved Hide resolved
distinct_id: 'test-id',
groups: { playlist: 'id:77' },
person_properties: {
Expand Down
4 changes: 3 additions & 1 deletion playground/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function App({ Component, pageProps }: AppProps) {
}
}, [])

const localhostDomain = process.env.NEXT_PUBLIC_CROSSDOMAIN ? 'https://localhost:8000' : 'http://localhost:8000'
const localhostDomain = process.env.NEXT_PUBLIC_CROSSDOMAIN
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helper if runnning on localhost:8010

? 'https://localhost:8000'
: process.env.NEXT_PUBLIC_POSTHOG_HOST

return (
<PostHogProvider client={posthog}>
Expand Down
329 changes: 0 additions & 329 deletions src/__tests__/decide.ts

This file was deleted.

Loading
Loading