fix: persist sticky notes cache from memory on state changes - #3083
fix: persist sticky notes cache from memory on state changes#3083amirbiron wants to merge 1 commit into
Conversation
ה-cache ב-localStorage לא התעדכן אחרי עריכת פתק דביק, מה שגרם לכך שאחרי ריענון הדף הפתק הוצג ריק עד שה-API הגיב. נוספה מתודה _persistCacheFromMemory שנקראת ב-4 מקומות: - _queueSave (מיד עם עריכה) - _performSaveBatch (אחרי batch save) - _flushFor (אחרי שמירה בודדת) - _flushPendingKeepalive (לפני סגירת דף) https://claude.ai/code/session_01UCWnSj4UYXMzYYi4UFWHBa
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern) |
סיכוםמתי הבאג התחיל?מהיום הראשון - הפיצ'ר נוסף ב-commit מה היה הבאג?ב-
אם ה-API איטי או נכשל (רשת, session פג), הפתק נשאר ריק. מה התיקון?נוספה מתודה
|
⏱️ Performance report(No performance test durations collected. Mark tests with |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| const nextSeq = (this._pendingSeq.get(id) || 0) + 1; | ||
| this._pendingSeq.set(id, nextSeq); | ||
| } catch(_) {} | ||
| this._persistCacheFromMemory(); |
There was a problem hiding this comment.
Unbounded localStorage writes on every keystroke
Medium Severity
_persistCacheFromMemory() is called inside _queueSave, which fires on every textarea input event (every keystroke). This synchronously iterates all notes, runs JSON.stringify on the entire collection, and writes to localStorage on the main thread — on every single character typed. The existing _saveDebounced() on the next line was intentionally debounced at 500ms to avoid this exact kind of overhead. The persist call bypasses that debouncing entirely, potentially causing noticeable input lag when many notes exist.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |


✨ תיאור קצר
הוספת קריאות ל-
_persistCacheFromMemory()בנקודות קריטיות בזרימת הסנכרון כדי להבטיח שהמטמון המקומי (localStorage) יישמר עם המצב הנוכחי של ההערות בזיכרון.📦 שינויים עיקריים
פירוט:
_persistCacheFromMemory()- מתודה חדשה שמאחסנת את כל ההערות מהזיכרון ל-localStorage_addPending()- לאחר הוספת הערה חדשה_flushPendingKeepalive()- לפני שליחת keepalive_processPendingUpdates()- לאחר עיבוד עדכונים_sendUpdate()- לאחר שליחת עדכון🧪 בדיקות
📝 סוג שינוי
✅ צ'קליסט
🧩 השפעות/סיכונים
🔗 קישורים
https://claude.ai/code/session_01UCWnSj4UYXMzYYi4UFWHBa