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

[BUG] Beacon sender reports error for success when diagnostics are enabled #2204

Closed
johnc-ftl opened this issue Nov 27, 2023 · 0 comments
Closed

Comments

@johnc-ftl
Copy link

johnc-ftl commented Nov 27, 2023

I had to enable:

  loggingLevelConsole: 2

to troubleshoot an issue I'm encountering (duplicate telemetry being reported), and it turns out that a failure message is always reported every time the beacon sender is used to send telemetry, even when the request is successfully queued. I receive console warning messages like:

AI (Internal): 26 message:"Failed to send telemetry." props:"(request payload)"

every time telemetry is sent, even though the request was successful.

Screenshot of callstack plus one of the problematic functions:
image

It appears that this issue was introduced by:
f4da17e#diff-d1f29788d9390adbc9ff2f85e60bf370be120a7985298d0657fea9ff831e5322

though I'm not 100% confident in stating that. Obviously there aren't tests to verify correct error reporting for this case.

In Sender.ts, after the beacon is successfully queued the payload is sent to oncomplete as the response:
image

In _getOnComplete() if there is a response, whether or not the status code is 200 an error is reported:
image

Steps to Reproduce

SDK Version:
"name": "@microsoft/applicationinsights-channel-js",
"version": "3.0.5"

Configuration:

  // Prefer beacon API for tracking
  isBeaconApiDisabled: false,
  loggingLevelConsole: 2

Expected behavior

Beacon requests that succeed don't result in reported errors, when diagnostics is enabled.

@MSNev MSNev added the bug label Dec 5, 2023
@MSNev MSNev modified the milestones: 3.0.x, 3.0.6 Dec 5, 2023
MSNev added a commit that referenced this issue Dec 7, 2023
- [BUG] Beacon sender reports error for success when diagnostics are enabled #2204
MSNev added a commit that referenced this issue Dec 7, 2023
- [BUG] Beacon sender reports error for success when diagnostics are enabled #2204
MSNev added a commit that referenced this issue Dec 7, 2023
- [BUG] Beacon sender reports error for success when diagnostics are enabled #2204
@MSNev MSNev added fixed - waiting release PR Committed and waiting deployment waiting - CDN deployment released - NPM and removed fixed - waiting release PR Committed and waiting deployment waiting - CDN deployment labels Dec 7, 2023
@MSNev MSNev closed this as completed Dec 11, 2023
MSNev added a commit that referenced this issue Jan 11, 2024
[release-3.0][Release] Increase version to 3.0.7 (#2224)
[release-3.0] Cherrypick: fix fetchkeepalive (#2216) (#2223)
[Release-3.0][Release] Increase version to 3.0.6 (#2211)
  - [BUG] Beacon sender reports error for success when diagnostics are enabled #2204
[Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender (#2208) (#2210)
* [Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender (#2208)
* fix sendbeacon sender
* update
* Add release-3.0 branch to the actions
MSNev added a commit that referenced this issue Jan 17, 2024
[release-3.0][Release] Increase version to 3.0.7 (#2224)
[release-3.0] Cherrypick: fix fetchkeepalive (#2216) (#2223)
[Release-3.0][Release] Increase version to 3.0.6 (#2211)
  - [BUG] Beacon sender reports error for success when diagnostics are enabled #2204
[Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender (#2208) (#2210)
* [Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender (#2208)
* fix sendbeacon sender
* update
* Add release-3.0 branch to the actions
[release-3.0] Update components
MSNev added a commit that referenced this issue Jan 18, 2024
[release-3.0][Release] Increase version to 3.0.7 (#2224)
[release-3.0] Cherrypick: fix fetchkeepalive (#2216) (#2223)
[Release-3.0][Release] Increase version to 3.0.6 (#2211)
  - [BUG] Beacon sender reports error for success when diagnostics are enabled #2204
[Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender (#2208) (#2210)
* [Main][Task]26079397: Add disableBeaconSplit sender config and fix potential duplicated events during unload/fallback sender (#2208)
* fix sendbeacon sender
* update
* Add release-3.0 branch to the actions
[release-3.0] Update components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants