Skip to content

Commit

Permalink
chore: update privacy data analytic
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 13, 2024
1 parent bb18f84 commit b5e401a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
5 changes: 0 additions & 5 deletions electron/tests/e2e/thread.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,4 @@ test('Select GPT model from Hub and Chat with Invalid API Key', async ({
},
{ timeout: TIMEOUT }
)

const APIKeyError = page.getByTestId('passthrough-error-message')
await expect(APIKeyError).toBeVisible({
timeout: TIMEOUT,
})
})
21 changes: 21 additions & 0 deletions web/containers/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ const BaseLayout = () => {
disable_session_recording: true,
person_profiles: 'always',
persistence: 'localStorage',
opt_out_capturing_by_default: true,
// eslint-disable-next-line @typescript-eslint/naming-convention
sanitize_properties: function (properties) {
const denylist = [
'$pathname',
'$initial_pathname',
'$current_url',
'$initial_current_url',
'$host',
'$initial_host',
'$initial_person_info',
]

denylist.forEach((key) => {
if (properties[key]) {
properties[key] = null // Set each denied property to null
}
})

return properties
},
})
posthog.opt_in_capturing()
posthog.register({ app_version: VERSION })
Expand Down
1 change: 1 addition & 0 deletions web/screens/Settings/Privacy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const Privacy = () => {
if (e.target.checked) {
posthog.opt_in_capturing()
} else {
posthog.capture('user_opt_out', { timestamp: new Date() })
posthog.opt_out_capturing()
}
setProductAnalytic(e.target.checked)
Expand Down

0 comments on commit b5e401a

Please sign in to comment.