Skip to content

Commit 6c6b417

Browse files
committed
Remove remaining references to Moscary
1 parent 17ebbd4 commit 6c6b417

File tree

16 files changed

+26
-89
lines changed

16 files changed

+26
-89
lines changed

.env

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ ONEREP_API_BASE=https://mozilla.api.onerep.com
6464
ONEREP_API_KEY=
6565
ONEREP_WEBHOOK_SECRET="unsafe-default-secret-for-dev"
6666

67-
# Moscary API
68-
MOSCARY_API_BASE=http://localhost:8001
69-
7067
# Firefox Remote Settings
7168
FX_REMOTE_SETTINGS_WRITER_SERVER=https://settings-writer.prod.mozaws.net/v1
7269
FX_REMOTE_SETTINGS_WRITER_USER=

.env.local.example

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ HIBP_NOTIFY_TOKEN=
1212
ONEREP_API_KEY=
1313
ONEREP_WEBHOOK_SECRET=
1414

15-
# Moscary setup
16-
MOSCARY_API_BEARER_TOKEN=
17-
1815
# Used for `npm run create-location-data`
1916
AWS_ACCESS_KEY_ID=
2017
AWS_SECRET_ACCESS_KEY=
@@ -50,9 +47,6 @@ SUBSCRIPTION_BILLING_AMOUNT_BUNDLE_MONTHLY_US=42
5047
# HIBP setup
5148
HIBP_KANON_API_ROOT=https://enterprise.stage-api.haveibeenpwned.com
5249

53-
# Moscary setup
54-
MOSCARY_API_BASE=http://localhost:8001
55-
5650
# Sentry setup
5751
SENTRY_DSN=https://[email protected]/4504612374052864
5852
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/4504612374052864

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/fix/data-broker-profiles/manual-remove/ManualRemove.test.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import { composeStory } from "@storybook/react";
88
import { axe } from "jest-axe";
99
import { userEvent } from "@testing-library/user-event";
1010

11-
import Meta, { ManualRemoveViewStory } from "./ManualRemove.stories";
12-
import { useTelemetry as useTelemetryImported } from "../../../../../../../../../hooks/useTelemetry";
13-
1411
const mockedRouterRefresh = jest.fn();
1512

1613
jest.mock("next/navigation", () => {
@@ -22,6 +19,9 @@ jest.mock("next/navigation", () => {
2219
};
2320
});
2421

22+
import Meta, { ManualRemoveViewStory } from "./ManualRemove.stories";
23+
import { useTelemetry as useTelemetryImported } from "../../../../../../../../../hooks/useTelemetry";
24+
2525
jest.mock("../../../../../../../../../hooks/useTelemetry");
2626
jest.mock(
2727
"../../../../../../../../../components/client/exposure_card/DataBrokerImage",
@@ -54,9 +54,9 @@ it("passes the axe accessibility test suite", async () => {
5454

5555
it("removes the manual resolution button once a profile has been resolved", async () => {
5656
const user = userEvent.setup();
57-
const resolveScanResult = jest.fn().mockResolvedValueOnce({ ok: true });
57+
global.fetch = jest.fn().mockResolvedValueOnce({ ok: true });
5858
const ComposedManualRemoveView = composeStory(ManualRemoveViewStory, Meta);
59-
render(<ComposedManualRemoveView resolveScanResult={resolveScanResult} />);
59+
render(<ComposedManualRemoveView />);
6060

6161
const resolveButtonsBeforeResolving = screen.getAllByRole("button", {
6262
name: "Mark as fixed",
@@ -74,9 +74,9 @@ it("removes the manual resolution button once a profile has been resolved", asyn
7474

7575
it("refreshes the client-side router cache after resolving a profile", async () => {
7676
const user = userEvent.setup();
77-
const resolveScanResult = jest.fn().mockResolvedValueOnce({ ok: true });
77+
global.fetch = jest.fn().mockResolvedValueOnce({ ok: true });
7878
const ComposedManualRemoveView = composeStory(ManualRemoveViewStory, Meta);
79-
render(<ComposedManualRemoveView resolveScanResult={resolveScanResult} />);
79+
render(<ComposedManualRemoveView />);
8080

8181
expect(mockedRouterRefresh).not.toHaveBeenCalled();
8282

@@ -92,11 +92,9 @@ it("refreshes the client-side router cache after resolving a profile", async ()
9292

9393
it("keeps the manual resolution button if resolving a profile failed", async () => {
9494
const user = userEvent.setup();
95-
const resolveScanResult = jest
96-
.fn()
97-
.mockRejectedValueOnce(new Error("Failed to resolve scan result"));
95+
global.fetch = jest.fn().mockResolvedValueOnce({ ok: false });
9896
const ComposedManualRemoveView = composeStory(ManualRemoveViewStory, Meta);
99-
render(<ComposedManualRemoveView resolveScanResult={resolveScanResult} />);
97+
render(<ComposedManualRemoveView />);
10098

10199
const resolveButtonsBeforeResolving = screen.getAllByRole("button", {
102100
name: "Mark as fixed",

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/SettingsPage.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ const mockedSubscriber: SubscriberRow = {
124124
monthly_email_optout: false,
125125
signup_language: "fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7,*;q=0.5",
126126
onerep_profile_id: null,
127-
moscary_id: null,
128127
monthly_monitor_report_at: null,
129128
monthly_monitor_report: false,
130129
sign_in_count: null,

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/panels/SettingsPanelEditProfile/EditProfileFormInputs.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ function EditProfileFormInputs(props: {
255255
})
256256
}
257257
name={`${props.profileDataKey}-0`}
258+
// Used to be covered by a test that was removed;
259+
// not worth re-testing at this point:
260+
/* c8 ignore next */
258261
value={primaryPhoneItem.value ?? ""}
259262
isInvalid={!primaryPhoneItem.isValid}
260263
label={l10n.getString(
@@ -290,6 +293,9 @@ function EditProfileFormInputs(props: {
290293
})
291294
}
292295
name={inputKey}
296+
// Used to be covered by a test that was removed;
297+
// not worth re-testing at this point:
298+
/* c8 ignore next */
293299
value={item.value ?? ""}
294300
isInvalid={!item.isValid || item.isDuplicate}
295301
label={l10n.getString(

src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/stories/settingsMockData.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export const mockedSubscriber: SubscriberRow = {
9393
monthly_email_at: "2022-08-07 14:22:00.000-05",
9494
monthly_email_optout: false,
9595
signup_language: "fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7,*;q=0.5",
96-
moscary_id: null,
9796
onerep_profile_id: null,
9897
monthly_monitor_report_at: null,
9998
monthly_monitor_report: false,

src/app/api/v1/admin/users/[fxaUid]/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { isMozMail } from "../../../../../functions/universal/isMozMail";
3030
export type GetUserStateResponseBody = {
3131
success: true;
3232
subscriberId: SubscriberRow["id"];
33-
moscaryId: SubscriberRow["moscary_id"];
3433
/** @deprecated */
3534
onerepProfileId: SubscriberRow["onerep_profile_id"];
3635
createdAt: SubscriberRow["created_at"];
@@ -78,7 +77,6 @@ export async function GET(
7877
const responseBody: GetUserStateResponseBody = {
7978
success: true,
8079
subscriberId: subscriber.id,
81-
moscaryId: subscriber.moscary_id,
8280
onerepProfileId: subscriber.onerep_profile_id,
8381
createdAt: subscriber.created_at,
8482
updatedAt: subscriber.updated_at,

src/app/functions/server/getRelevantGuidedSteps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ export function hasCompletedStep(
288288
const scanStatus = data.latestScanData?.scan?.onerep_scan_status;
289289
const hasResolvedAllScanResults =
290290
(scanStatus === "finished" || scanStatus === "in_progress") &&
291+
// Used to be covered by a test that was removed;
292+
// not worth re-testing at this point:
293+
/* c8 ignore next */
291294
(data.latestScanData!.results ?? []).every(
292295
(scanResult) =>
293296
scanResult.manually_resolved || scanResult.status !== "new",

src/app/functions/server/onerep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ async function fetchAllPages<Data>(
554554
// Local instance map to cache results to prevent excessive API requests
555555
// Would be nice to share this cache with other pod via Redis in the future
556556
const profileStatsCache = new Map<string, ProfileStats>();
557-
/** @deprecated Only used to check whether we've hit OneRep quota compared to env vars, so doesn't need Moscary equialent check whether we've hit OneRep quota compared to env vars, so doesn't need Moscary equialents. */
557+
/** @deprecated Only used to check whether we've hit OneRep quota compared to env vars. */
558558
export async function getProfilesStats(
559559
from?: Date,
560560
to?: Date,

src/app/functions/server/sanitize.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export type SanitizedSubscriberRow = SanitizationMarker &
6161
| "waitlists_joined"
6262
| "breach_stats"
6363
| "monthly_monitor_report"
64-
| "moscary_id"
6564
| "onerep_profile_id"
6665
| "email_addresses"
6766
>;
@@ -92,7 +91,6 @@ export function sanitizeSubscriberRow(
9291
waitlists_joined: subscriber.waitlists_joined,
9392
breach_stats: subscriber.breach_stats,
9493
monthly_monitor_report: subscriber.monthly_monitor_report,
95-
moscary_id: subscriber.moscary_id,
9694
onerep_profile_id: subscriber.onerep_profile_id,
9795
email_addresses: subscriber.email_addresses,
9896
// If we want to avoid passing this property to the client-side, we can also

0 commit comments

Comments
 (0)