forked from jsnbuchanan/crowd-funder-for-time-pwa
feat(db): improve settings retrieval resilience and logging
Enhance retrieveSettingsForActiveAccount with better error handling and logging while maintaining core functionality. Changes focus on making the system more debuggable and resilient without overcomplicating the logic. Key improvements: - Add structured error handling with specific try-catch blocks - Implement detailed logging with [databaseUtil] prefix for easy filtering - Add graceful fallbacks for searchBoxes parsing and missing settings - Improve error recovery paths with safe defaults - Maintain existing security model and data integrity Security: - No sensitive data in logs - Safe JSON parsing with fallbacks - Proper error boundaries - Consistent state management - Clear fallback paths Testing: - Verify settings retrieval works with/without active DID - Check error handling for invalid searchBoxes - Confirm logging provides clear debugging context - Validate fallback to default settings works
This commit is contained in:
@@ -1119,6 +1119,7 @@ export default class AccountViewView extends Vue {
|
||||
*/
|
||||
async mounted() {
|
||||
try {
|
||||
console.log("[AccountViewView] mounted");
|
||||
// Initialize component state with values from the database or defaults
|
||||
await this.initializeState();
|
||||
await this.processIdentity();
|
||||
@@ -1171,6 +1172,7 @@ export default class AccountViewView extends Vue {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("[AccountViewView] error: ", JSON.stringify(error, null, 2));
|
||||
// this can happen when running automated tests in dev mode because notifications don't work
|
||||
logger.error(
|
||||
"Telling user to clear cache at page create because:",
|
||||
|
||||
Reference in New Issue
Block a user