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

release(required): Fix logger storage initialization errors #14009

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/polyfills/URL/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/core/src/storage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
} catch (e) {
// Handle any errors related to localStorage access
logger.error('LocalStorage access failed:', e);
logger.info('localStorage access failed. InMemoryStorage is used as a fallback.');

Check failure on line 23 in packages/core/src/storage/utils.ts

View workflow job for this annotation

GitHub Actions / unit-tests / Unit Test - @aws-amplify/core

Replace `'localStorage·access·failed.·InMemoryStorage·is·used·as·a·fallback.'` with `⏎↹↹↹'localStorage·access·failed.·InMemoryStorage·is·used·as·a·fallback.',⏎↹↹`
yuhengshs marked this conversation as resolved.
Show resolved Hide resolved
}

// Return in-memory storage as a fallback if localStorage is not accessible
Expand All @@ -44,7 +44,9 @@
throw new Error('sessionStorage is not defined');
} catch (e) {
// Handle any errors related to sessionStorage access
logger.error('SessionStorage access failed:', e);
logger.info(
'sessionStorage access failed. InMemoryStorage is used as a fallback.',
yuhengshs marked this conversation as resolved.
Show resolved Hide resolved
);

return new InMemoryStorage();
}
Expand Down
Loading