[Reporting/Telemetry] Do not send telemetry if we are in screenshot mode#100388
Conversation
Bamieh
left a comment
There was a problem hiding this comment.
code changes LGTM! a very welcomed changed :elasticheart:
Can we add a functional test do make sure this is working in the browser as intended?
afharo
left a comment
There was a problem hiding this comment.
Thank you for these changes! This will prove super useful!
I've added a couple of comments & NITs.
| ApplicationStart, | ||
| } from 'src/core/public'; | ||
|
|
||
| import { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/public'; |
There was a problem hiding this comment.
NIT:
| import { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/public'; | |
| import type { ScreenshotModePluginSetup } from 'src/plugins/screenshot_mode/public'; |
| }); | ||
|
|
||
| describe('shouldSendTelemetry', () => { | ||
| it('does not send telemetry if screenshotMode is true', () => { |
There was a problem hiding this comment.
Can we test the other scenario as well?
| return this.isOptedIn; | ||
| }; | ||
|
|
||
| public canSendTelemetry = (): boolean => { |
There was a problem hiding this comment.
Would you mind adding the JSDocs to this public method?
| }; | ||
|
|
||
| public canSendTelemetry = (): boolean => { | ||
| return Boolean(this.getIsOptedIn() && !this.isScreenshotMode); |
There was a problem hiding this comment.
NITs:
- Why do we need to wrap it as Boolean?
- Can we check
isScreenshotModefirst to avoid running the additional checks ofgetIsOptedIn()?
There was a problem hiding this comment.
Why do we need to wrap it as Boolean?
I wanted to be explicit about the return type and getIsOptedIn returns a boolean | null. Happy to update that function return value with a Boolean() instead?
Can we check isScreenshotMode first to avoid running the additional checks of getIsOptedIn()?
Can do!
* added another Jest test * move Boolean() to make the opt-in value always boolean
- added plugin functional test - added jest test to check TelemetrySender behaviour - exported the localStorage/window value that flags screenshot mode
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
|
Pinging @elastic/kibana-reporting-services (Team:Reporting Services) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Public APIs missing comments
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
…ode (elastic#100388) * do not send telemetry if isScreenshotMode * Implement PR feedback: * added another Jest test * move Boolean() to make the opt-in value always boolean * remove unused import and convert to import type * fix type issues * update jest snapshot * Expanded test coverage - added plugin functional test - added jest test to check TelemetrySender behaviour - exported the localStorage/window value that flags screenshot mode * fix test plugin name in package.json and make sure to opt out of telemetry when the test finishes * added missing type file to plugin_functional test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/telemetry/kibana.json
…ode (#100388) (#101076) * do not send telemetry if isScreenshotMode * Implement PR feedback: * added another Jest test * move Boolean() to make the opt-in value always boolean * remove unused import and convert to import type * fix type issues * update jest snapshot * Expanded test coverage - added plugin functional test - added jest test to check TelemetrySender behaviour - exported the localStorage/window value that flags screenshot mode * fix test plugin name in package.json and make sure to opt out of telemetry when the test finishes * added missing type file to plugin_functional test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/telemetry/kibana.json
…sens/kibana into reporting/new-png-pdf-report-type * 'reporting/new-png-pdf-report-type' of github.com:jloleysens/kibana: (46 commits) [Security Solution] Add Ransomware canary advanced policy option (elastic#101068) [Exploratory view] Core web vitals (elastic#100320) [Security solution][Endpoint] Add unit tests for fleet event filters/trusted apps cards (elastic#101034) [Lens] Use a setter function for the dimension panel (elastic#101123) [Index Patterns] Fix return saved index pattern object (elastic#101051) [CI] For PRs, build TS refs before public api docs check (elastic#100791) [Maps] fix line and polygon label regression (elastic#101085) Migrate CCR to new ES JS client. (elastic#100131) [Canvas] Switch Canvas to use React Router (elastic#100579) [Expressions] Use table column ID instead of name when set (elastic#99724) [DOCS] Updates docs landing page (elastic#100749) [DOCS] Corrects typo in step 3 (elastic#101079) [DOCS] Updates runtime example in Discover (elastic#100926) Migrate kibana.autocomplete config to data plugin (elastic#100586) [Uptime] New width/delay definition for waterfall sidebar item tooltip (elastic#100147) [FTR] Use importExport for saved_object/basic archive (elastic#100244) [Fleet] Better input for multi text input in agent policy builder (elastic#101020) [CI] Buildkite support with Baseline pipeline (elastic#100492) [Reporting/Telemetry] Do not send telemetry if we are in screenshot mode (elastic#100388) Create API keys with metadata (elastic#100682) ...
Summary
Fix #41402
To reviewers
Checklist
Delete any items that are not applicable to this PR.