Skip to content

Commit 1cad7d8

Browse files
masnobleDevtools-frontend LUCI CQ
authored andcommitted
Make invisible issues
The new 3p related cookie issues do not need to be surfaced to the user in the issue pane. Instead, they are going to be shown in the new Cookie Report. They still need a description to be properly added by the issuesManager, so this is why a placeholder description was added. The issueAggregator will exclude these issues so that the issue pane does not show them, while still making the issues accessible via the issuesManager. Bug: 365737493 Change-Id: Ib7c4b918935b7604cf57b0a1dcebb90c0297f4b2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5950123 Reviewed-by: Danil Somsikov <[email protected]> Commit-Queue: Joshua Thomas <[email protected]> Reviewed-by: Shuran Huang <[email protected]>
1 parent 52ea9e7 commit 1cad7d8

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

config/gni/devtools_grd_files.gni

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ grd_files_release_sources = [
471471
"front_end/models/issues_manager/descriptions/genericResponseWasBlockedByORB.md",
472472
"front_end/models/issues_manager/descriptions/heavyAd.md",
473473
"front_end/models/issues_manager/descriptions/mixedContent.md",
474+
"front_end/models/issues_manager/descriptions/placeholderDescriptionForInvisibleIssues.md",
474475
"front_end/models/issues_manager/descriptions/propertyRuleInvalidNameIssue.md",
475476
"front_end/models/issues_manager/descriptions/propertyRuleIssue.md",
476477
"front_end/models/issues_manager/descriptions/sharedArrayBuffer.md",

front_end/models/issues_manager/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ devtools_issue_description_files = [
196196
"sharedDictionaryWriteErrorShuttingDown.md",
197197
"sharedDictionaryWriteErrorTooLongIdField.md",
198198
"sharedDictionaryWriteErrorUnsupportedType.md",
199+
"placeholderDescriptionForInvisibleIssues.md",
199200
]
200201

201202
devtools_pre_built("descriptions") {

front_end/models/issues_manager/CookieIssue.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,14 @@ const cookieCrossSiteRedirectDowngrade: LazyMarkdownIssueDescription = {
542542
}],
543543
};
544544

545+
// This description will be used by cookie issues that need to be added to the
546+
// issueManager, but aren't intended to be surfaced in the issues pane. This
547+
// is why they are using a placeholder description
548+
const placeholderDescriptionForInvisibleIssues: LazyMarkdownIssueDescription = {
549+
file: 'placeholderDescriptionForInvisibleIssues.md',
550+
links: [],
551+
};
552+
545553
const issueDescriptions: Map<string, LazyMarkdownIssueDescription> = new Map([
546554
// These two don't have a deprecation date yet, but they need to be fixed eventually.
547555
['CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie', sameSiteUnspecifiedWarnRead],
@@ -585,6 +593,10 @@ const issueDescriptions: Map<string, LazyMarkdownIssueDescription> = new Map([
585593
],
586594
['CookieIssue::WarnThirdPartyPhaseout::ReadCookie', cookieWarnThirdPartyPhaseoutRead],
587595
['CookieIssue::WarnThirdPartyPhaseout::SetCookie', cookieWarnThirdPartyPhaseoutSet],
596+
['CookieIssue::WarnDeprecationTrialMetadata::ReadCookie', placeholderDescriptionForInvisibleIssues],
597+
['CookieIssue::WarnDeprecationTrialMetadata::SetCookie', placeholderDescriptionForInvisibleIssues],
598+
['CookieIssue::WarnThirdPartyCookieHeuristic::ReadCookie', placeholderDescriptionForInvisibleIssues],
599+
['CookieIssue::WarnThirdPartyCookieHeuristic::SetCookie', placeholderDescriptionForInvisibleIssues],
588600
['CookieIssue::ExcludeThirdPartyPhaseout::ReadCookie', cookieExcludeThirdPartyPhaseoutRead],
589601
['CookieIssue::ExcludeThirdPartyPhaseout::SetCookie', cookieExcludeThirdPartyPhaseoutSet],
590602
['CookieIssue::CrossSiteRedirectDowngradeChangesInclusion', cookieCrossSiteRedirectDowngrade],
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is a placeholder issue description
2+
3+
This description is used for issues that are not intended to be shown to the user. This means there is no need for a useful description.

front_end/panels/issues/IssueAggregator.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// found in the LICENSE file.
44

55
import * as Common from '../../core/common/common.js';
6+
import * as Protocol from '../../generated/protocol.js';
67
import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
7-
import type * as Protocol from '../../generated/protocol.js';
88

99
type AggregationKeyTag = {
1010
aggregationKeyTag: undefined,
@@ -268,6 +268,15 @@ export class IssueAggregator extends Common.ObjectWrapper.ObjectWrapper<EventTyp
268268
}
269269

270270
#onIssueAdded(event: Common.EventTarget.EventTargetEvent<IssuesManager.IssuesManager.IssueAddedEvent>): void {
271+
const excludeFromAggregate = [
272+
Protocol.Audits.CookieWarningReason.WarnThirdPartyCookieHeuristic,
273+
Protocol.Audits.CookieWarningReason.WarnDeprecationTrialMetadata,
274+
];
275+
276+
if (excludeFromAggregate.some(exclude => event.data.issue.code().includes(exclude))) {
277+
return;
278+
}
279+
271280
this.#aggregateIssue(event.data.issue);
272281
}
273282

0 commit comments

Comments
 (0)