Clarify log error with a '[Pocketbase]' prefix

This commit is contained in:
BlackSigkill 2026-02-05 12:19:21 +01:00
parent 679a405d41
commit 8e9ffaa694

View file

@ -18,10 +18,8 @@ const syncManager = {
_isSyncing: false,
async _getUserRecord(uid) {
if (!uid) {
console.warn('_getUserRecord called with no UID.');
return null;
}
if (!uid) return null;
if (this._userRecordCache && this._userRecordCache.firebase_id === uid) {
return this._userRecordCache;
}
@ -46,11 +44,11 @@ const syncManager = {
this._userRecordCache = newRecord;
return newRecord;
} catch (createError) {
console.error('Failed to create user record in PocketBase:', createError);
console.error('[PocketBase] Failed to create user:', createError);
return null;
}
}
console.error('Failed to get user record from PocketBase:', error);
console.error('[PocketBase] Failed to get user:', error);
return null;
}
},
@ -567,10 +565,10 @@ const syncManager = {
window.dispatchEvent(new CustomEvent('history-changed'));
window.dispatchEvent(new HashChangeEvent('hashchange'));
console.log('[PocketBase] ✓ Sync completed successfully');
console.log('[PocketBase] ✓ Sync completed');
}
} catch (error) {
console.error('Error during PocketBase sync!', error);
console.error('[PocketBase] Sync error:', error);
} finally {
this._isSyncing = false;
}