Skip to content

Commit

Permalink
fix: Refactor decide loading (#1596)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Dec 13, 2024
1 parent 2c12b4f commit 065c911
Show file tree
Hide file tree
Showing 15 changed files with 491 additions and 667 deletions.
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',
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
? '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

0 comments on commit 065c911

Please sign in to comment.