Skip to content

Commit 1602ea3

Browse files
kellyw1806claude
andcommitted
🎨 [FFL-2857] drop comments that restate the code
Remove field docs that repeated their own names or the enclosing interface doc, and replace the opaque RFC 7009 aside on tryRevokeGrant with a plain explanation plus a link on revokeAndClearTokens. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2db8cfc commit 1602ea3

5 files changed

Lines changed: 9 additions & 20 deletions

File tree

‎developer-extension/src/panel/components/tabs/flagsTab/flagCatalogList.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ function FlagRow({
132132
py="sm"
133133
style={{
134134
borderBottom: '1px solid var(--mantine-color-default-border)',
135-
// Mantine's scheme-aware subtle tint (the one variant="light" uses), not a saturated fill.
136135
backgroundColor: overridden ? 'var(--mantine-color-violet-light)' : undefined,
137136
}}
138137
>
@@ -209,7 +208,6 @@ function FlagDescription({ description }: { description: string }) {
209208
}, [description, expanded])
210209

211210
return (
212-
// Slightly more separation than the name↔key gap, so the row reads as "title/key" then "description".
213211
<Box mt={4}>
214212
<Text ref={textRef} size="xs" lineClamp={expanded ? undefined : 1}>
215213
{description}

‎developer-extension/src/panel/components/tabs/flagsTab/flagIdentity.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ import { fetchFfeJson, ForbiddenError } from './ffeApi'
1010
import { getFlagsApiHost } from './oauth'
1111

1212
export interface FlagIdentity {
13-
/** UUID of the signed-in user, or null when it couldn't be resolved. */
1413
userId: string | null
15-
/** Handles of the teams the signed-in user belongs to, sorted for stable display. */
1614
teamHandles: string[]
17-
/** True when the team lookup was refused because the user lacks permission to read teams. */
1815
teamsForbidden: boolean
19-
/** True when the team lookup failed for another reason (network/server), distinct from an empty membership. */
2016
teamsUnavailable: boolean
2117
}
2218

‎developer-extension/src/panel/components/tabs/flagsTab/flagsRequests.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@ import { getFlagsApiHost } from './oauth'
55
export interface CatalogFlag {
66
key: string
77
name: string
8-
/** Free-text description authored in the Datadog UI. Empty when the flag has none. */
98
description: string
109
type: FlagType
1110
/** Parsed value of each variant (any JSON value); see parseVariantValue. */
1211
variants: Array<{ name: string; value: unknown }>
1312
tags: string[]
14-
/**
15-
* UUID of the user who created the flag. Undefined for flags created by a service account or
16-
* integration. Compared against the signed-in user's UUID for the "My feature flags" filter.
17-
*/
13+
/** Undefined for flags created by a service account or integration, which carry no user UUID. */
1814
createdBy?: string
1915
}
2016

@@ -33,9 +29,7 @@ export interface FlagCatalogRequest {
3329
search: string
3430
typeFilter: string[]
3531
tagFilter: string[]
36-
/** Team handles for the "My teams" filter, sent as `tags=team:<handle>`. */
3732
teamFilter: string[]
38-
/** The signed-in user's UUID when "My feature flags" is on, else null. Sent as `created_by`. */
3933
createdBy: string | null
4034
}
4135

‎developer-extension/src/panel/components/tabs/flagsTab/oauth.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ export async function clearStoredTokens(): Promise<void> {
228228
}
229229

230230
/**
231-
* Ends the connection: revokes the grant at Datadog (RFC 7009), then drops the local tokens.
232-
* Clearing locally alone would only make this extension forget them — the grant would stay live and
233-
* any copy of the refresh token would keep working.
231+
* Ends the connection: revokes the grant at Datadog, then drops the local tokens. Clearing locally
232+
* alone would only make this extension forget them — the grant would stay live and any copy of the
233+
* refresh token would keep working. Revocation follows https://datatracker.ietf.org/doc/html/rfc7009.
234234
*
235235
* Returns whether the revocation succeeded. Local tokens are cleared either way, so a user who asked
236236
* to disconnect ends up disconnected even if Datadog is unreachable; the caller reports a failure as
@@ -244,9 +244,11 @@ export async function revokeAndClearTokens(site: string): Promise<{ revoked: boo
244244
}
245245

246246
/**
247-
* Revokes the refresh token — the renewable part of the grant. The access token is left to expire
248-
* (RFC 7009 only *recommends* cascading revocation, so we don't rely on it) and is dropped locally
249-
* by the caller. Refreshes first because the revoke endpoint authenticates with a Bearer token.
247+
* Revokes the refresh token, since that's the renewable part of the grant — revoking only the access
248+
* token would leave the grant able to mint new ones. The short-lived access token is left to expire
249+
* on its own, and dropped locally by the caller.
250+
*
251+
* Refreshes first: the revoke endpoint authenticates the caller with a Bearer token.
250252
*/
251253
async function tryRevokeGrant(site: string): Promise<boolean> {
252254
try {

‎developer-extension/src/panel/components/tabs/flagsTab/useFlagCatalogView.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useEffect, useMemo, useState } from 'react'
22
import type { FlagCatalogRequest } from './flagsRequests'
33

44
const CATALOG_PAGE_SIZE = 20
5-
// Long enough to wait out a typing burst, short enough to still feel responsive.
65
const SEARCH_DEBOUNCE_MS = 400
76

87
export interface FlagCatalogView {

0 commit comments

Comments
 (0)