snowplow / snowplow/snowplow-javascript-tracker
Consider returning a promise from flush method in node tracker
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 590
- Forks
- 232
- Avg merge
- 2h 22m
- Merged PRs (30d)
- 3
Description
Is your feature request related to a problem? Please describe.
Currently gotEmitter's flush method is not async and returns void instead of a promise.
This makes it harder to use in environments where a promise is needed to ensure all async tasks complete before exiting (e.g. AWS Lambda async handlers).
Describe the solution you'd like
flush is async/returns a promise.
Describe alternatives you've considered
At the moment the way to ensure flush completes in such environments is to wrap the emitter in a promise, and configure it with a callback that resolves and rejects that promise.
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 by locating the gotEmitter flush implementation and its existing callback path. Trace how asynchronous tasks signal completion, then verify that flush resolves or rejects only after those tasks finish and that existing callback behavior remains covered by the relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100