Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fetch notifications in background" #5234

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

gonzaloriestra
Copy link
Contributor

@gonzaloriestra gonzaloriestra commented Jan 20, 2025

It looks like this is causing a new terminal to pop up for a second on Windows, so I'm reverting until we find a solution.

I've tried by enabling the windowsHide flag, but it's not working. Apparently Node doesn't allow it on Windows with detached = true.

Reverts #5020

Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/notifications-system.d.ts
@@ -166,25 +166,11 @@ export type Notifications = zod.infer<typeof NotificationsSchema>;
  */
 export declare function showNotificationsIfNeeded(currentSurfaces?: string[], environment?: NodeJS.ProcessEnv): Promise<void>;
 /**
- * Get notifications list from cache, that is updated in the background from bin/fetch-notifications.json.
+ * Get notifications list from cache (refreshed every hour) or fetch it if not present.
  *
  * @returns A Notifications object.
  */
 export declare function getNotifications(): Promise<Notifications>;
-/**
- * Fetch notifications from the CDN and chache them.
- *
- * @returns A string with the notifications.
- */
-export declare function fetchNotifications(): Promise<Notifications>;
-/**
- * Fetch notifications in background as a detached process.
- *
- * @param currentCommand - The current Shopify command being run.
- * @param argv - The arguments passed to the current process.
- * @param environment - Process environment variables.
- */
-export declare function fetchNotificationsInBackground(currentCommand: string, argv?: string[], environment?: NodeJS.ProcessEnv): void;
 /**
  * Filters notifications based on the version of the CLI.
  *
packages/cli-kit/dist/public/node/system.d.ts
@@ -12,7 +12,6 @@ export interface ExecOptions {
     input?: string;
     signal?: AbortSignal;
     externalErrorHandler?: (error: unknown) => Promise<void>;
-    background?: boolean;
 }
 /**
  * Opens a URL in the user's default browser.

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.34% (+0.09% 🔼)
8873/11777
🟡 Branches
70.59% (+0.16% 🔼)
4318/6117
🟡 Functions
75.1% (+0.02% 🔼)
2328/3100
🟡 Lines
75.87% (+0.07% 🔼)
8385/11052
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
93.83% (-1.23% 🔻)
86.49% (-2.7% 🔻)
90.48% 98.61%
🔴
... / system.ts
46.67% (+1.99% 🔼)
31.25% (-0.33% 🔻)
66.67%
47.73% (+2.08% 🔼)

Test suite run success

2000 tests passing in 904 suites.

Report generated by 🧪jest coverage report action from 05afd3f

@gonzaloriestra
Copy link
Contributor Author

/snapit

Copy link
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by intalling your package globally:

pnpm i -g @shopify/cli@0.0.0-snapshot-20250120124423

After installing, validate the version by running just shopify in your terminal
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra gonzaloriestra marked this pull request as ready for review January 20, 2025 12:50
@gonzaloriestra gonzaloriestra requested review from a team as code owners January 20, 2025 12:50
@gonzaloriestra gonzaloriestra added this pull request to the merge queue Jan 20, 2025
Merged via the queue into main with commit db34c1c Jan 20, 2025
28 checks passed
@gonzaloriestra gonzaloriestra deleted the revert-5020-fetch-notifications-in-background branch January 20, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants