fix(logs): suppress dm sync spam and allow local image paths

This commit is contained in:
google-labs-jules[bot] committed 2026-01-05 21:23:32 +00:00
1 parent b24aac7349
commit 5ed5554f51
3 files changed
+14 -5

No files matched your search

+1 -1
View File
@@ -392,7 +392,7 @@ export default class ApplicationBootstrap {
app.loginModalController = null;
app.currentUserNpub = null;
app.initializeLoginModalController({ logIfMissing: true });
app.initializeLoginModalController({ logIfMissing: false });
app.profileButton = doc?.getElementById("profileButton") || null;
app.profileAvatar = doc?.getElementById("profileAvatar") || null;
+9 -4
View File
@@ -1124,6 +1124,7 @@ export class ProfileModalController {
this.directMessagesUnsubscribes = [];
this.pendingMessagesRender = null;
this.messagesStatusClearTimeout = null;
this.lastDirectMessageErrorTime = 0;
this.profileHistoryRenderer = null;
this.profileHistoryRendererConfig = null;
@@ -2417,10 +2418,14 @@ export class ProfileModalController {
handleDirectMessagesError(detail = {}) {
const error = detail?.error || detail?.failure || detail;
userLogger.warn(
"[profileModal] Direct message sync issue detected:",
error,
);
const now = Date.now();
if (now - this.lastDirectMessageErrorTime > 5000) {
userLogger.warn(
"[profileModal] Direct message sync issue detected:",
error,
);
this.lastDirectMessageErrorTime = now;
}
if (this.activeMessagesRequest) {
return;
+4
View File
@@ -62,6 +62,10 @@ export function sanitizeProfileMediaUrl(value) {
return trimmed;
}
if (/^images\//i.test(trimmed)) {
return trimmed;
}
if (!/^https?:\/\//i.test(trimmed)) {
if (LOCALHOST_PATTERN.test(trimmed)) {
trimmed = `http://${trimmed}`;