maniator / maniator/verticopolis

[P3] setCommonProps can strip the build version from every later event

Open
#805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

analyticsCore.ts seeds commonProps with { version: APP_VERSION } at module load, so every event names its build whatever the entry point. But setCommonProps replaces the object wholesale, and the module-load guarantee currently survives only because the one production caller happens to re-supply the same constant: bootCommonProps takes version as a parameter and appBoot passes APP_VERSION back in.

So there are two mechanisms for one fact. Any future direct setCommonProps({...}) caller that omits version silently strips it from every subsequent event in that session, and nothing fails: the existing tripwire suite asserts the props are {} after a reset, so it would not notice.

Not a live bug. The only callers today are the boot enrichment (which carries version) and a test-only reset.

Two ways to close it, either fine:

  • have setCommonProps preserve version across a replace, so the guarantee is structural rather than conventional; or
  • have bootCommonProps read APP_VERSION itself instead of taking it as a parameter, removing the second source entirely.

Found by the confirming pass on #801.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read analyticsCore.ts, especially setCommonProps and the bootCommonProps/appBoot path, then inspect the existing tripwire suite. Confirm how a replacement omitting version affects later events, choose one of the two proposed designs, and add coverage showing the build version remains guaranteed after common props are set.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.