Skip to content

Commit 81b2d19

Browse files
committed
fix: address code review feedback
- privacy.ts: don't spread message in catch block to avoid leaking sensitive fields; return only safe metadata (level, date). Add one-time stderr warning when redaction fails for observability. - store/index.ts: warn when watch() is called before store is initialized so callers aren't silently left in uninitialized state. - hu.i18n.json: fix 'bolt' (shop) -> 'tároló' (storage) for software store references. Add missing trailing period for consistency.
1 parent 589a74d commit 81b2d19

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/i18n/hu.i18n.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
},
294294
"videoCallWindowPersistence": {
295295
"title": "A videohívás-ablak pozíciójának megjegyzése",
296-
"description": "A videohívás-ablakok pozíciójának és méretének mentése és helyreállítása a munkamenetek között"
296+
"description": "A videohívás-ablakok pozíciójának és méretének mentése és helyreállítása a munkamenetek között."
297297
},
298298
"transparentWindow": {
299299
"title": "Átlátszó ablak hatás",
@@ -497,12 +497,12 @@
497497
}
498498
},
499499
"status": {
500-
"moduleNotAvailable": "A bolt modul nem érhető el a kiszolgáló környezetének leképezésénél",
501-
"importFailed": "A bolt importálása nem sikerült"
500+
"moduleNotAvailable": "A tároló modul nem érhető el a kiszolgáló környezetének leképezésénél",
501+
"importFailed": "A tároló importálása nem sikerült"
502502
},
503503
"errors": {
504504
"configurationFailed": "Nem sikerült beállítani az elektronnaplót",
505-
"storeUnavailable": "A bolt modul nem érhető el a kiszolgáló környezetének leképezésénél",
505+
"storeUnavailable": "A tároló modul nem érhető el a kiszolgáló környezetének leképezésénél",
506506
"webContentsLoggingFailed": "Nem sikerült beállítani a webtartalmak naplózását",
507507
"rendererLogFailed": "Nem sikerült naplózni a megjelenítőből",
508508
"consoleOverrideFailed": "Nem sikerült felülbírálni a konzol metódusait"

src/logging/privacy.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ const redactObject = (obj: any, seen = new WeakSet()): any => {
9797
return obj;
9898
};
9999

100+
let privacyHookFailed = false;
101+
100102
export const createPrivacyHook = () => {
101103
return (message: any, _transport: any, _transportName?: string) => {
102104
try {
@@ -110,9 +112,15 @@ export const createPrivacyHook = () => {
110112
});
111113
return { ...message, data: sanitizedData };
112114
} catch {
113-
// Don't emit raw data on failure - only safe placeholder
115+
if (!privacyHookFailed) {
116+
privacyHookFailed = true;
117+
process.stderr.write(
118+
'[privacy] redaction hook threw; falling back to placeholder\n'
119+
);
120+
}
114121
return {
115-
...message,
122+
level: message.level,
123+
date: message.date,
116124
data: ['[Privacy redaction failed]'],
117125
};
118126
}

src/store/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ export const watch = <T>(
7575
selector: Selector<T>,
7676
watcher: (curr: T, prev: T | undefined) => void
7777
): (() => void) => {
78-
if (!reduxStore) return () => undefined;
78+
if (!reduxStore) {
79+
console.warn('[store] watch() called before store initialized');
80+
return () => undefined;
81+
}
7982
const initial = select(selector);
8083
watcher(initial, undefined);
8184

0 commit comments

Comments
 (0)