Skip to content

Commit fdfc5eb

Browse files
committed
fix(app): make cloud reconnect cutoff exclusive
1 parent 442cc0b commit fdfc5eb

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

apps/app/src/app/(app)/[orgId]/cloud-tests/components/ProviderTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export function ProviderTabs({
307307
<div>
308308
<p className="text-sm font-medium">Reconnect this account</p>
309309
<p className="text-xs text-muted-foreground mt-0.5">
310-
This connection was created on or before {CLOUD_RECONNECT_CUTOFF_LABEL}. Reconnect it to keep scans and remediation fully reliable.
310+
This connection was created before {CLOUD_RECONNECT_CUTOFF_LABEL}. Reconnect it to keep scans and remediation fully reliable.
311311
</p>
312312
</div>
313313
{canAddConnection !== false && (

apps/app/src/app/(app)/[orgId]/cloud-tests/components/TestsLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export function TestsLayout({ initialFindings, initialProviders, orgId }: TestsL
288288
Reconnect required for {reconnectRequiredCount} cloud connection{reconnectRequiredCount === 1 ? '' : 's'}
289289
</p>
290290
<p className="text-xs text-muted-foreground mt-0.5">
291-
Connections created on or before {CLOUD_RECONNECT_CUTOFF_LABEL} should be re-added to keep scans and remediation fully reliable.
291+
Connections created before {CLOUD_RECONNECT_CUTOFF_LABEL} should be re-added to keep scans and remediation fully reliable.
292292
</p>
293293
</div>
294294
)}

apps/app/src/app/(app)/[orgId]/integrations/[slug]/components/ProviderDetailView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export function ProviderDetailView({ provider, initialConnections }: ProviderDet
199199
<div>
200200
<p className="text-sm font-medium">Reconnect this account</p>
201201
<p className="text-xs text-muted-foreground mt-0.5">
202-
This connection was created on or before {CLOUD_RECONNECT_CUTOFF_LABEL}. Reconnect it to keep scans and remediation fully reliable.
202+
This connection was created before {CLOUD_RECONNECT_CUTOFF_LABEL}. Reconnect it to keep scans and remediation fully reliable.
203203
</p>
204204
</div>
205205
<Button size="sm" variant="outline" onClick={() => void handleConnect()}>

apps/app/src/lib/cloud-reconnect-policy.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,26 @@ import {
55
} from './cloud-reconnect-policy';
66

77
describe('requiresCloudReconnect', () => {
8-
it('returns true for cloud connections created on the cutoff date', () => {
8+
it('returns true for cloud connections created before the cutoff date', () => {
99
expect(
1010
requiresCloudReconnect({
1111
providerId: 'aws',
12-
createdAt: CLOUD_RECONNECT_CUTOFF_ISO_UTC,
12+
createdAt: '2026-04-12T23:59:59.999Z',
1313
status: 'active',
1414
}),
1515
).toBe(true);
1616
});
1717

18+
it('returns false for cloud connections created exactly at the cutoff timestamp', () => {
19+
expect(
20+
requiresCloudReconnect({
21+
providerId: 'aws',
22+
createdAt: CLOUD_RECONNECT_CUTOFF_ISO_UTC,
23+
status: 'active',
24+
}),
25+
).toBe(false);
26+
});
27+
1828
it('returns false for cloud connections created after the cutoff date', () => {
1929
expect(
2030
requiresCloudReconnect({
@@ -45,4 +55,3 @@ describe('requiresCloudReconnect', () => {
4555
).toBe(false);
4656
});
4757
});
48-

apps/app/src/lib/cloud-reconnect-policy.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const CLOUD_RECONNECT_PROVIDER_IDS = new Set(['aws', 'gcp', 'azure']);
22

33
/**
4-
* Connections created on or before this UTC timestamp require re-connection.
4+
* Connections created before this UTC timestamp require re-connection.
55
* This rollout date is fixed intentionally so the behavior is stable over time.
66
*/
7-
export const CLOUD_RECONNECT_CUTOFF_ISO_UTC = '2026-04-13T23:59:59.999Z';
7+
export const CLOUD_RECONNECT_CUTOFF_ISO_UTC = '2026-04-13T00:00:00.000Z';
88
export const CLOUD_RECONNECT_CUTOFF_LABEL = 'April 13, 2026';
99

1010
const CLOUD_RECONNECT_CUTOFF_MS = new Date(CLOUD_RECONNECT_CUTOFF_ISO_UTC).getTime();
@@ -29,6 +29,5 @@ export function requiresCloudReconnect(candidate: ReconnectCandidate): boolean {
2929
const createdAt = new Date(candidate.createdAt);
3030
if (Number.isNaN(createdAt.getTime())) return false;
3131

32-
return createdAt.getTime() <= CLOUD_RECONNECT_CUTOFF_MS;
32+
return createdAt.getTime() < CLOUD_RECONNECT_CUTOFF_MS;
3333
}
34-

0 commit comments

Comments
 (0)