-
Notifications
You must be signed in to change notification settings - Fork 224
Capture Conf update errors #6475
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
Conversation
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success3243 tests passing in 1340 suites. Report generated by 🧪jest coverage report action from 33b6549 |
MitchDickinson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments/questions
Also I'm very curious how this fixes the maximum stack exceeded error. What kind of expected user error could trigger that? Is it a bug in a dependency we use or something?
00700f7 to
8decdbe
Compare
gonzaloriestra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested it on Linux/Windows?
MitchDickinson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Really nice change
20cd9b9 to
96fa7d5
Compare
96fa7d5 to
33b6549
Compare
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/fs.d.ts@@ -239,6 +239,8 @@ export declare function chmod(path: string, mode: number | string): Promise<void
* @param path - Path to the file whose permissions will be checked.
*/
export declare function fileHasExecutablePermissions(path: string): Promise<boolean>;
+export declare function fileHasWritePermissions(path: string): boolean;
+export declare function unixFileIsOwnedByCurrentUser(path: string): boolean | undefined;
/**
* Returns true if a file or directory exists.
*
packages/cli-kit/dist/public/node/local-storage.d.ts@@ -15,6 +15,8 @@ export declare class LocalStorage<T extends {
*
* @param key - The key to get.
* @returns The value.
+ * @throws AbortError if a permission error occurs.
+ * @throws BugError if an unexpected error occurs.
*/
get<TKey extends keyof T>(key: TKey): T[TKey] | undefined;
/**
@@ -22,16 +24,36 @@ export declare class LocalStorage<T extends {
*
* @param key - The key to set.
* @param value - The value to set.
+ * @throws AbortError if a permission error occurs.
+ * @throws BugError if an unexpected error occurs.
*/
set<TKey extends keyof T>(key: TKey, value?: T[TKey]): void;
/**
* Delete a value from the local storage.
*
* @param key - The key to delete.
+ * @throws AbortError if a permission error occurs.
+ * @throws BugError if an unexpected error occurs.
*/
delete<TKey extends keyof T>(key: TKey): void;
/**
* Clear the local storage (delete all values).
+ *
+ * @throws AbortError if a permission error occurs.
+ * @throws BugError if an unexpected error occurs.
*/
clear(): void;
+ /**
+ * Handle errors from config operations.
+ * If the error is permission-related, throw an AbortError with helpful hints.
+ * Otherwise, throw a BugError.
+ *
+ * @param error - The error that occurred.
+ * @param operation - The operation that failed.
+ * @throws AbortError if the error is permission-related.
+ * @throws BugError if the error is not permission-related.
+ */
+ private handleError;
+ private isPermissionError;
+ private tryMessage;
}
\ No newline at end of file
|

WHY are these changes introduced?
We have many reports of "Maximum call stack size exceeded" from the Conf dependency.
This an attempt of capturing those and identify the source.
WHAT is this pull request doing?
Capture all possible errors thrown by
Conf, show a more useful message. If it's a permissions error, report it ashandled and show a useful message to users.If the error is not a permissions one, re-throw a BugError instead.
How to test your changes?
~/Library/Preferences/shopify-cli-app-nodejsMeasuring impact
How do we know this change was effective? Please choose one:
Checklist