Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add limits for Analytics events resending #590

Closed

Conversation

powerful23
Copy link
Contributor

Issue #, if available:

Description of changes:
To avoid infinite retries for Analytics resending events.

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

@codecov-io
Copy link

codecov-io commented Apr 4, 2018

Codecov Report

Merging #590 into master will decrease coverage by 0.03%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #590      +/-   ##
==========================================
- Coverage   89.15%   89.11%   -0.04%     
==========================================
  Files          69       69              
  Lines        3219     3226       +7     
  Branches      611      613       +2     
==========================================
+ Hits         2870     2875       +5     
- Misses        331      333       +2     
  Partials       18       18
Impacted Files Coverage Δ
packages/aws-amplify/src/Analytics/Analytics.ts 88.23% <86.36%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e98ad53...f86f32c. Read the comment docs.

@@ -29,6 +29,7 @@ const logger = new Logger('AnalyticsClass');
const BUFFER_SIZE = 1000;
const MAX_SIZE_PER_FLUSH = BUFFER_SIZE * 0.1;
const interval = 5*1000; // 5s
const RESEND_LIMIT = 5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these values perhaps be configurable via the pluggable / config since different situations / systems may require different values.

@powerful23 powerful23 requested a review from mbahar as a code owner April 9, 2018 22:48
@Jun711
Copy link

Jun711 commented Apr 11, 2018

This is to fix this potential bug, right?

When I had window.LOG_LEVEL='DEBUG' on but not using Analytics, I noticed this message is fired continuously.

{"[DEBUG] 23:50.499 AWSAnalyticsProvider - record event failed. ": Error: Missing region in config
at Request.VALIDATE_REGION (webpack-internal:///../../../../aws-…}

amplify version 0.2.14

@powerful23
Copy link
Contributor Author

@Jun711 Yes. By the way, if you don't want to use Analytics, you can turn it off manually. You can check this doc

@Jun711
Copy link

Jun711 commented Apr 11, 2018

Thanks @powerful23
I don't use awsmobile though. it would be great if I know which line to add in. Thanks.

@powerful23
Copy link
Contributor Author

@Jun711
Copy link

Jun711 commented Apr 11, 2018

thanks @powerful23 . after your pull request, I don't have to set disabled to false to disable Analytics?
(resending events retry issue)

@powerful23
Copy link
Contributor Author

@Jun711 yes

@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants