awslabs / clickstream-web

Web SDK for Clickstream Analytics on AWS
https://aws.amazon.com/solutions/implementations/clickstream-analytics-on-aws/
Apache License 2.0
15 stars 0 forks source link

feat: support sending events in background #10

Closed zhu-xiaowei closed 1 year ago

zhu-xiaowei commented 1 year ago

Description

  1. support sending events in background
  2. support sending events immediately in batch mode

General Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.34% :tada:

Comparison is base (6b3b527) 99.65% compared to head (69f8945) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #10 +/- ## =========================================== + Coverage 99.65% 100.00% +0.34% =========================================== Files 24 24 Lines 882 928 +46 Branches 151 168 +17 =========================================== + Hits 879 928 +49 + Misses 3 0 -3 ``` | [Files Changed](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs) | Coverage Δ | | |---|---|---| | [src/provider/AnalyticsEventBuilder.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL3Byb3ZpZGVyL0FuYWx5dGljc0V2ZW50QnVpbGRlci50cw==) | `100.00% <ø> (ø)` | | | [src/types/Analytics.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL3R5cGVzL0FuYWx5dGljcy50cw==) | `100.00% <ø> (ø)` | | | [src/browser/BrowserInfo.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL2Jyb3dzZXIvQnJvd3NlckluZm8udHM=) | `100.00% <100.00%> (+2.85%)` | :arrow_up: | | [src/network/NetRequest.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL25ldHdvcmsvTmV0UmVxdWVzdC50cw==) | `100.00% <100.00%> (ø)` | | | [src/provider/ClickstreamProvider.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL3Byb3ZpZGVyL0NsaWNrc3RyZWFtUHJvdmlkZXIudHM=) | `100.00% <100.00%> (ø)` | | | [src/provider/EventRecorder.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL3Byb3ZpZGVyL0V2ZW50UmVjb3JkZXIudHM=) | `100.00% <100.00%> (ø)` | | | [src/tracker/SessionTracker.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL3RyYWNrZXIvU2Vzc2lvblRyYWNrZXIudHM=) | `100.00% <100.00%> (+1.44%)` | :arrow_up: | | [src/util/StorageUtil.ts](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c3JjL3V0aWwvU3RvcmFnZVV0aWwudHM=) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/awslabs/clickstream-web/pull/10/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

zhu-xiaowei commented 1 year ago

Changed the fix the preset click event when disable event bubbling feature to #11, and keep the feature sending events immediately in batch mode feature in #10, this feature is part of sending events in background.