snowplow / snowplow/snowplow-javascript-tracker
Deep clone attached global context entites
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 590
- Forks
- 232
- Avg merge
- 2h 22m
- Merged PRs (30d)
- 3
Description
Since global contexts are "long living" (the tracker keeps a reference to them until they are removed), we should deep clone any objects attached using addGlobalContexts to prevent unexpected changes when the original objects change in user code.
In particular, we should consider deep cloning around these lines.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libraries/tracker-core/src/contexts.ts around lines 183–184 and inspect how addGlobalContexts stores attached objects. Check nearby tests or tracker-core test coverage for global contexts; done means later changes to the original objects no longer alter the contexts retained by the tracker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100