Skip to content

This is a PR to resolve the issue of tracking being enable by default - #127

Open
Enielect wants to merge 4 commits into
thepersonalaicompany:mainfrom
Enielect:main
Open

This is a PR to resolve the issue of tracking being enable by default#127
Enielect wants to merge 4 commits into
thepersonalaicompany:mainfrom
Enielect:main

Conversation

@Enielect

Copy link
Copy Markdown

List of things I changed

  • I retrived a field that I created in the users table called analytics_enabled to check whether or not tracking is allowed.
  • The user is allowed to toggle the state of this value from the setting page with a Card consistent with the other setting options in the page.
  • I did a conditional check everywhere the /track endpoint was used to ensure that the user consented.
  • I made the value of the field to be false by default on the database.
  • This implementation is independent of whether the user is self-hosting or running cloud infra, the state is always false.

Enielect added 3 commits June 23, 2025 13:31
…ghtweight'. There seems to be an inconsistency with the latest version of novel-lightweight, so I just imported from 'novel' instead
@vercel

vercel Bot commented Jun 23, 2025

Copy link
Copy Markdown

@Enielect is attempting to deploy a commit to the The Personal AI Company Team on Vercel.

A member of the Team first needs to authorize it.

@dwi11harsh dwi11harsh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good work!

Comment thread src/app/search/page.js

// fetching user's sessions
const fetchUserThreads = async () => {
console.log(session?.user?.id, 'user Id from session in fetchUserThreads')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove log after using it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Okey I'll do this right away

Comment thread src/app/settings/page.js
.select("analytics_enabled")
.eq("id", userId)
.single();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

consider using
if (!analyticsEnabled) return;
to save additional api calls

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Noted. I'll get it done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants