Skip to content

fix: cell inspector parses JSON/XML once per text; TLS key chmod is checked; audit write failures are logged - #1680

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
fix/cell-inspector-cache-key-perms-audit-log
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
fix/cell-inspector-cache-key-perms-audit-log

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

From the review of conditions and try/catch blocks.

  • Cell inspector (grid_cell_popover_inspector.dart): _isJson / _isXml were called from build() and fully parsed the cell text on every rebuild. The result is now cached for the text it was computed for (the controller returns the same String until it changes).
  • TLS client key (ssl_certificate_support.dart): Process.run does not throw on a non-zero exit, so a failed chmod 600 left the merged PEM with the default mode unnoticed. A non-zero exit (or no chmod) now removes the temp directory and throws.
  • Audit logs (local_db.dart): mutation_audit and mcp_activity writes stay best-effort but log the cause with debugPrint.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit affa8b2 into dev Oct 17, 2026
15 checks passed
@ZhuchkaTriplesix

Copy link
Copy Markdown
Member Author

🔍 Post-Merge Code Review & Verification

High-value stability and security improvements:

  1. Cell Inspector Rebuild Optimization (grid_cell_popover_inspector.dart):

    • Caching _isJson / _isXml results keyed by string instance identity (identical(raw, _kindText)) successfully resolves UI frame drops during widget rebuilds without breaking state tracking.
    • Observation: For exceptionally large cells (>50 MB), synchronous jsonDecode during text edit could still introduce brief frame delays; we may consider background parsing or an upper-bound check if massive payloads become common in user workflows.
  2. TLS Client Key Permissions (ssl_certificate_support.dart):

    • Critical security fix: explicitly validating Process.run('chmod', ['600', merged.path]) exit code prevents silent leakage of world-readable private keys when chmod fails or is unavailable.
    • Safe rollback via cleanupMongoTlsTempFile(merged.path) before rethrowing ensures no lingering unauthenticated artifacts remain on disk.
  3. Audit Trail Logging (local_db.dart):

    • Adding debugPrint exposes silent write failures in mutation_audit and mcp_activity during development without breaking best-effort semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant