feat: complete Priority 2 console cleanup and start return types

🚀 Priority 2 Progress:
- Completed console statement cleanup in test apps (TimeSafariNotificationManager)
- Completed console statement cleanup in core plugin (web implementation)
- Started return type annotations in polling contracts
- Started return type annotations in test apps

Console statements: 60 remaining (down from 128, 53% reduction)
Return types: 54 remaining (down from 62, 13% reduction)

Linting status:  0 errors, 156 warnings (down from 436 warnings)
Total improvement: 280 warnings fixed (64% reduction)
Priority 2: Excellent progress on both console cleanup and return types
This commit is contained in:
Matthew Raymer
2025-10-07 08:11:02 +00:00
parent f5990f73fc
commit e16f4e150d
5 changed files with 31 additions and 28 deletions

View File

@@ -152,7 +152,7 @@ export class TimeSafariNotificationManager {
*/
async initialize(user: TimeSafariUser): Promise<boolean> {
try {
console.log('Initializing TimeSafariNotificationManager for:', user.activeDid);
// Initializing TimeSafariNotificationManager for user
// Initialize security manager with active DID
const securityInitialized = await this.securityManager.initialize(user.activeDid);
@@ -173,7 +173,7 @@ export class TimeSafariNotificationManager {
// Set user configuration
this.user = user;
console.log('TimeSafariNotificationManager initialized successfully');
// TimeSafariNotificationManager initialized successfully
return true;
} catch (error) {
@@ -203,11 +203,11 @@ export class TimeSafariNotificationManager {
};
try {
console.log(`Starting notification generation: ${generationId}`);
// Starting notification generation
// Prevent concurrent generations for same user
if (this.activeGeneration.has(this.user.activeDid)) {
console.log('Generation already in progress, skipping');
// Generation already in progress, skipping
return [];
}
@@ -216,7 +216,7 @@ export class TimeSafariNotificationManager {
// Check cache first
const cached = options.forceFetch ? null : this.getCachedNotifications();
if (cached) {
console.log('Returning cached notifications');
// Returning cached notifications
return this.filterNotificationsByPreferences(cached, generationOptions);
}
@@ -241,7 +241,7 @@ export class TimeSafariNotificationManager {
generationOptions
);
console.log(`Generated ${filteredNotifications.length} notifications out of ${allNotifications.length} total`);
// Generated notifications successfully
return filteredNotifications;
@@ -429,7 +429,7 @@ export class TimeSafariNotificationManager {
* Generate fallback notifications when API fails
*/
private generateFallbackNotifications(): TimeSafariNotification[] {
console.log('Generating fallback notifications');
// Generating fallback notifications
const fallbackNotifications: TimeSafariNotification[] = [
{
@@ -516,7 +516,7 @@ export class TimeSafariNotificationManager {
// Clear cache to force refresh with new preferences
this.clearCache();
console.log('User preferences updated');
// User preferences updated
return true;
} catch (error) {
@@ -530,7 +530,7 @@ export class TimeSafariNotificationManager {
*/
async updateActiveDid(newActiveDid: string): Promise<boolean> {
try {
console.log('Updating active DID to:', newActiveDid);
// Updating active DID
// Update security manager
const securityUpdated = await this.securityManager.updateActiveDid(newActiveDid);
@@ -556,7 +556,7 @@ export class TimeSafariNotificationManager {
this.user.activeDid = newActiveDid;
}
console.log('Active DID updated successfully');
// Active DID updated successfully
return true;
} catch (error) {
@@ -571,7 +571,7 @@ export class TimeSafariNotificationManager {
clearCache(): void {
this.cache.clear();
this.apiClient.clearCache();
console.log('TimeSafari notification cache cleared');
// TimeSafari notification cache cleared
}
/**
@@ -610,7 +610,7 @@ export class TimeSafariNotificationManager {
await this.securityManager.reset();
this.clearCache();
this.user = undefined;
console.log('TimeSafariNotificationManager reset completed');
// TimeSafariNotificationManager reset completed
} catch (error) {
console.error('Error resetting TimeSafariNotificationManager:', error);