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

feat: Create elements chain string as we store it #823

Merged
merged 16 commits into from
Nov 20, 2023

Conversation

tiina303
Copy link
Contributor

@tiina303 tiina303 commented Oct 5, 2023

@posthog-bot
Copy link
Collaborator

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Collaborator

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Collaborator

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

src/autocapture-utils.ts Fixed Show fixed Hide fixed
}

function escapeQuotes(input: string): string {
return input.replace(/"/g, '\\"')

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This does not escape backslash characters in the input.
Copy link

github-actions bot commented Nov 7, 2023

Size Change: +6.22 kB (+1%)

Total Size: 745 kB

Filename Size Change
dist/array.full.js 177 kB +1.56 kB (+1%)
dist/array.js 118 kB +1.55 kB (+1%)
dist/es.js 118 kB +1.55 kB (+1%)
dist/module.js 118 kB +1.55 kB (+1%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 12 kB
dist/recorder-v2.js 104 kB
dist/recorder.js 58.4 kB
dist/surveys.js 39.9 kB

compressed-size-action

@davemurphysf davemurphysf marked this pull request as ready for review November 14, 2023 19:43
@@ -255,7 +256,7 @@ const autocapture = {
const props = _extend(
this._getDefaultProperties(e.type),
{
$elements: elementsJson,
$elements_chain: getElementsChainString(elementsJson),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should gradually roll this out to team 2 first for safety, see how capture-rs rollouts are happening

@davemurphysf davemurphysf added the bump minor Bump minor version when this PR gets merged label Nov 20, 2023
@davemurphysf davemurphysf requested a review from a team November 20, 2023 03:38
Copy link
Contributor Author

@tiina303 tiina303 left a comment

Choose a reason for hiding this comment

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

Can't approve my own pull requests, but looks good, so you can approve it @davemurphysf 😅

davemurphysf added a commit to PostHog/posthog that referenced this pull request Nov 20, 2023
* Adding flag in decide response to allow returning elements chain as a string; related PR: PostHog/posthog-js#823

* Created a separate env var to control this behavior in https://github.com/PostHog/posthog-cloud-infra/pull/2314

* Update query snapshots

* Add env var

* Update query snapshots

* Formatting

* Just use a boolean

* Add test for when ELEMENT_CHAIN_AS_STRING_TEAMS is set and not set

* Fix test

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@davemurphysf davemurphysf merged commit 1d8eac6 into master Nov 20, 2023
13 checks passed
@davemurphysf davemurphysf deleted the elements-chain-string branch November 20, 2023 18:37
Copy link
Contributor

@davemurphysf davemurphysf left a comment

Choose a reason for hiding this comment

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

LGTM (obvs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor Bump minor version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants