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: Better client info replacement #8423

Closed
wants to merge 1 commit into from

Conversation

ivanagas
Copy link
Contributor

@ivanagas ivanagas commented May 7, 2024

Changes

In many places in code snippets, <ph_project_api_key> and <ph_client_api_host> aren't being replaced. There seems to be two reasons for this:

  1. We only check if the string exactly matches, meaning we miss cases where <ph_project_api_key> is part of a larger string.
  2. Because of how the code block works, a <ph_project_api_key> is being split in 3 tokens and not matching the check.

CleanShot 2024-05-07 at 14 13 41@2x

This fixes both these issues. Some feedback requested:

  1. I'm not sure either of these approaches are actually good ones.
  2. I'm not sure the impact on performance, the replaceClientApiInfo function is two loops which could be problematic.

@ivanagas ivanagas self-assigned this May 7, 2024
Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog ❌ Failed (Inspect) May 7, 2024 10:58pm

@ivanagas
Copy link
Contributor Author

Eli did it better

@ivanagas ivanagas closed this Jun 12, 2024
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.

None yet

1 participant