Skip to content

Main convert - #383

Merged
JosephSamirL merged 21 commits into
mainfrom
main-convert
May 21, 2026
Merged

Main convert#383
JosephSamirL merged 21 commits into
mainfrom
main-convert

Conversation

@abbaseya

@abbaseya abbaseya commented May 21, 2026

Copy link
Copy Markdown
Collaborator

hassaantahir0 and others added 21 commits April 3, 2026 16:09
Update pages, publish-package, and release-please workflows to use
Node 22, matching the QA workflow that already runs on Node 22.
Update Serving API  - from backend PR #6390
Update Serving API  - from backend PR #6424
…ookie-condition

feat: adding cookie (exist , not exist) conditions
Bumps @convertcom/js-sdk-types peer range to >=3.11.0 across api,
bucketing, data, event, experience, js-sdk, rules, segments; bumps
@convertcom/js-sdk-rules to >=2.1.4 in data, js-sdk, segments. Picked
up by yarn 4 during a local build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reorders the QA workflow to install yarn deps before Playwright
browsers, and uses `yarn playwright install` instead of `npx`. With
`npx` running before `yarn`, node_modules was empty so npx fetched the
latest playwright from npm (1.60.0 today) and downloaded chromium
binaries for that revision. The job then ran tests against the
project's pinned @playwright/test@1.59.1, which expects a different
chromium-headless-shell build, hitting "Executable doesn't exist at
.../chromium_headless_shell-1217/..." on every browser test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Update Serving API  - from backend PR #6604
The yarn.lock on main-convert was bumped to lockfile metadata
`version: 9` by a local install with yarn >=4.11. The backend's V1
tracking build runs `yarn install` in immutable mode under yarn
4.10.3 (per `public/js/tracking/package.json` packageManager field),
which writes `version: 8` lockfiles — triggering YN0028 and failing
staging deploys.

Pinning `packageManager: yarn@4.10.3` here makes the toolchain
explicit and prevents future drift when contributors run install
with a newer yarn.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(ci): pin yarn to 4.10.3 and regenerate lockfile
Context.runExperience and Context.runExperiences rebuilt a fresh
attributes object with only four hardcoded keys (visitorProperties,
locationProperties, updateVisitorProperties, environment) before
forwarding to ExperienceManager.selectVariation/selectVariations.

This silently dropped every other BucketingAttributes field —
enableTracking, forceVariationId, ignoreLocationProperties,
typeCasting, experienceKeys — so callers opting out of tracking,
forcing a variation, or ignoring location targeting were silently
ignored. DataManager._getBucketingByField destructures these by name
with enableTracking defaulting to `true`, which is how the opt-out
was being lost.

Switch to spread-then-override so all caller-supplied attributes pass
through while still applying the two transforms Context must do:
merging visitorProperties via getVisitorProperties() and defaulting
environment to the Context's own environment.

Add tests covering forwarding of enableTracking, forceVariationId,
ignoreLocationProperties, and updateVisitorProperties through both
runExperience and runExperiences.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-attributes

fix(context): forward all BucketingAttributes to ExperienceManager
@abbaseya abbaseya self-assigned this May 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@abbaseya
abbaseya requested a review from a team May 21, 2026 15:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the package manager to Yarn 4 and increments several dependency versions. It refactors the JS SDK context to forward bucketing attributes using spread syntax and introduces new cookie existence rules ('exists' and 'doesNotExist') with corresponding comparison utilities and tests. Additionally, it converts numerous type definitions into enums. Reviewers recommend using camelCase for the new comparison methods, restoring documentation lost during enum conversion, and ensuring that new types like PlanStatus and Products are implemented as enums to match the project's refactoring goals.

Comment thread packages/utils/src/comparisons.ts
Comment thread packages/utils/tests/comparisons.tests.ts
Comment thread packages/types/src/config/types.gen.ts
Comment thread packages/types/src/config/types.gen.ts
Comment thread packages/types/src/config/types.gen.ts
Comment thread packages/types/src/config/types.gen.ts
Comment thread packages/types/src/config/types.gen.ts
@JosephSamirL
JosephSamirL merged commit 892b618 into main May 21, 2026
8 checks passed
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.

3 participants