תצוגת מסמכי קולקציה - #2898
Conversation
מדריך מפורט ב-4 שלבים:
- שלב 1: Backend - הוספת get_documents() ל-db_health_service
- שלב 2: API - endpoint חדש /api/db/{collection}/documents
- שלב 3: Frontend - JavaScript לטעינה ודפדוף
- שלב 4: UI - תצוגת JSON עם pagination
כולל:
- קוד מוכן להעתקה
- וולידציה ואבטחה
- בדיקות יחידה
- רשימת תיוג למימוש
Co-authored-by: amirbiron <amirbiron@gmail.com>Cursor Agent can help with this pull request. Just |
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern) |
⏱️ Performance report(No performance test durations collected. Mark tests with |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
שיפורים עיקריים: - הפרדת סטטוסי שגיאה: 400/403/404 נפרדים - הוספת sort(_id) ל-pagination יציבה - Custom Exceptions ייעודיים - הסרת list_collection_names() מכל בקשה (ביצועים) - הוספת _redact_sensitive_fields() להסתרת PII - Whitelist/Denylist ל-collections - הערה על מגבלות skip (MVP) - כותרת דינמית עם שם Collection - כפתור Copy JSON - Empty state ברור - CodeMirror עם theme דינמי - תיקון עקביות HTML/JS (pre + textarea) Co-authored-by: amirbiron <amirbiron@gmail.com>
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
1. JavaScript - תיקון קריסה על JSON לא תקין: - הוספת try/catch נפרד לפרסור JSON - וולידציה של מבנה התשובה (typeof total, Array.isArray) - שימוש ב-optional chaining (?.) לגישה בטוחה 2. Python - תיקון חישוב has_more: - שינוי מ-(skip + len) < total ל-len(documents) == limit - מונע תוצאות שגויות כשיש מחיקות בין count ל-find - תיקון בשתי הגרסאות (Async + Sync) 3. בדיקות - עדכון לשיקוף הלוגיקה החדשה: - הוספת test_get_documents_last_page - שינוי test_get_documents_success להחזיר עמוד מלא Co-authored-by: amirbiron <amirbiron@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- הוספת בדיקה אם כבר אותחל לפני יצירת instance חדש - שמירת reference ל-MutationObserver במשתנה גלובלי - הוספת פונקציית destroyDocumentsEditor() לניקוי - בדיקת קיום window.documentsEditor לפני setOption Co-authored-by: amirbiron <amirbiron@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 5 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1. Nested list redaction - רקורסיה מלאה על רשימות מקוננות
- שינוי הפונקציה לטפל ב-list לפני dict
- [[{'token': 'x'}]] עכשיו מטופל נכון
2. Race condition - מניעת עדכון state מתשובות ישנות
- הוספת currentRequestId
- בדיקה לפני עדכון state ובטיפול בשגיאות
3. CodeMirror/pre visibility - רק אחד מוצג בכל רגע
- בדיקת window.documentsEditor לפני הצגה
- הסתרת pre כש-CodeMirror פעיל
4. Frontend uses backend has_more - ללא חישוב כפול
- שימוש ב-data.has_more במקום returnedCount < DOCS_LIMIT
5. Skip upper bound - מניעת DoS
- הוספת MAX_SKIP = 10000
- בדיקה ב-endpoint עם שגיאה 400
- קיצוץ ב-service layer
Co-authored-by: amirbiron <amirbiron@gmail.com>Uh oh!
There was an error while loading. Please reload this page.
✨ תיאור קצר
GUIDES/COLLECTION_DOCUMENTS_VIEWER_GUIDE.md) למימוש תכונת צפייה במסמכים בתוך קולקציות MongoDB בדשבורד ה-Database Health.📦 שינויים עיקריים
פירוט נקודות (רשימת תבליטים):
GUIDES/COLLECTION_DOCUMENTS_VIEWER_GUIDE.md.🧪 בדיקות
🧪 בדיקות נדרשות ב‑PR
📝 סוג שינוי
✅ צ'קליסט
services/register_jobs.py(כולל Callback/Trigger להפעלה ידנית — למשלcallback_name/trigger_funcלפי המבנה) כדי שיופיעו בדשבורדdocs/environment-variables.rstוגםservices/config_inspector_service.pydocs/webapp/theming_and_css.rst+FEATURE_SUGGESTIONS/theme_matrix.md🧩 השפעות/סיכונים
🔗 קישורים
🧯 סיכון / החזרה לאחור (Rollback)
GUIDES/COLLECTION_DOCUMENTS_VIEWER_GUIDE.md.Note
Adds a comprehensive implementation guide for a new Database Health feature to view MongoDB collection documents, without changing runtime code.
GUIDES/COLLECTION_DOCUMENTS_VIEWER_GUIDE.mddetailing a 4-step plan: service methods (get_documentsasync/sync), API endpointGET /api/db/{collection}/documentswith pagination and validation, frontend logic/UI (viewer, pagination, copy JSON), and optional CodeMirror integrationWritten by Cursor Bugbot for commit a505b88. This will update automatically on new commits. Configure here.