snowplow / snowplow/snowplow-javascript-tracker

Properly allow for type SelfDescribingJSON to be added on `addGlobalContexts`

Open
#1,304 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:defect
Dominant language
TypeScript
Stars
590
Forks
232
Avg merge
2h 22m
Merged PRs (30d)
3

Description

Describe the bug
Currently the addGlobalContexts function does not allow for typed SelfDescribingJSON schemas to be added.

To Reproduce

https://github.com/snowplow/snowplow-javascript-tracker/assets/15251081/4b4ed24f-5bdd-4184-8871-1f658b17453c

Expected behavior
The addGlobalContexts function allows for proper SelfDescribingJSON objects to be passed to it.

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

Start at the TypeScript definition and implementation of addGlobalContexts, then trace the SelfDescribingJSON type used by its arguments. Reproduce the reported typing failure with a typed SelfDescribingJSON object and add or update a focused test; done means valid typed objects are accepted without weakening the intended type checks.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.