Skip to content

Native sql write fix#623

Open
TimRl wants to merge 28 commits intomainfrom
native-sql-write-fix
Open

Native sql write fix#623
TimRl wants to merge 28 commits intomainfrom
native-sql-write-fix

Conversation

@TimRl
Copy link
Contributor

@TimRl TimRl commented Feb 11, 2026

No description provided.

…nting native SQLite support. Updated database interactions to use AsyncDatabase for improved performance and reliability. Adjusted various components to handle asynchronous database operations, ensuring smoother user experience and error handling. (Need to add mirroring for FFmpeg, ?FFprobe?, and sqlite3 for redundancy)
…r handling during cleanup operations. Added checks for SQLite readiness in the SyncManager to prevent unnecessary index rebuilds. Enhanced dirty cell tracking in CodexCellDocument to ensure accurate state management. Updated SQLite binary management with version checks and retry logic for downloads, ensuring integrity and reducing corruption risks.
…proper closure of database connections during extension deactivation. Enhanced error handling in the CodexCellDocument for failed AI learning attempts, allowing for retries on subsequent saves. Improved download logic in the SQLite binary manager to handle redirects and prevent concurrent downloads, ensuring integrity and reliability of the native binary setup.
…y checks. Added applyProductionPragmas method to ensure optimal database settings on connection open. Implemented quickIntegrityCheck for early corruption detection during startup. Updated updateWordIndex to batch inserts within a transaction for improved performance. Adjusted database initialization in sqldb to apply PRAGMAs consistently.
…mmands and files. Updated .gitignore and .vscodeignore to exclude unnecessary directories. Cleaned up package.json by removing obsolete menu commands and dependencies. Enhanced README with clearer setup instructions and removed outdated build steps. Streamlined SQLite index management by eliminating legacy word indexing logic and related commands.
…ds with Backtranslation commands. Removed unused smart edits files and streamlined merge strategies by eliminating references to smart edits. Updated package.json description for clarity and adjusted documentation to reflect changes in merge strategies.
@TimRl TimRl self-assigned this Feb 11, 2026
@TimRl TimRl added bug Something isn't working enhancement New feature or request labels Feb 11, 2026
… native SQLite database tests with a bootstrap strategy for locating the native binary. Added functions for binary search and initialization checks to ensure proper test execution.
…ly in CI environments without the pre-downloaded binary, improving test reliability and clarity.
@TimRl TimRl force-pushed the native-sql-write-fix branch from 14fb962 to 5a4422d Compare February 12, 2026 15:00
TimRl added 15 commits February 12, 2026 14:20
…e batch processing. Introduced a two-phase approach: first reading files in parallel, then writing to the database in a single transaction to avoid transaction conflicts. Updated SQLiteIndexManager to implement a promise-based mutex for serializing access to transactions, ensuring robust handling of concurrent operations.
…reation process. Replaced debug statements with console logs for better visibility during rebuild decisions and health checks. Improved database connection management by ensuring old connections are closed before deletion to prevent file descriptor leaks. Updated integrity check to handle unexpected column names and added detailed comments for clarity.
…was hidden in registerQuillSpellChecker()

This global was never explicitly set anywhere else, yet 34+ call sites across TextCellEditor.tsx, Editor.tsx, AddParatextButton.tsx, and index.tsx depended on it for all webview-to-extension communication via postMessage.
…nse processing. Removed redundant code for handling prompted edit responses, focusing on LLM completion responses instead. This change simplifies the logic and improves maintainability.
…syncs to ensure data integrity. Enhanced SQLiteIndexManager to verify project identity and handle database recreation on mismatches. Updated health check logic to account for interrupted rebuilds, ensuring robust recovery. Added safeguards in project swap operations to close SQLite index manager before file operations, preventing orphaned file descriptors.
… batch size is 5 or more. Refined error handling in SQLiteIndexManager by consolidating database recreation logic into a single method for improved clarity and reliability during load and schema version mismatch scenarios.
…l file paths for failures. Enhanced transaction management in SQLiteIndexManager to ensure production settings are restored even after errors. Updated project deletion process to safely close the SQLite index manager, preventing orphaned file descriptors.
…c metadata, enhancing encapsulation. Improved SQLiteIndexManager to prevent new transactions during closure and added safeguards against use-after-close scenarios in AsyncDatabase. Updated project deletion process to ensure all related index files are removed safely.
… and SQLiteIndexManager. Added detailed comments to clarify the behavior of batch transactions and error recovery processes. Updated the ensureOpen method in SQLiteIndexManager to prevent operations on closed databases, improving stability and reliability during database interactions.
…teIndexWithContext. Updated SQLiteIndexManager to return -1 for unknown schema versions and ensured database connection is open before executing commands. Enhanced error handling in AsyncDatabase to prevent processing after rejection, improving stability during database operations.
…s in a shared module. Updated FileSyncManager to include content hash during file synchronization. Enhanced database initialization in SQLiteIndexManager to utilize shared schema constants for consistency across production and tests. Improved test suite to align with the new schema structure, ensuring accurate database interactions.
…handling and transaction management. Added detailed logging for database operations, ensuring better diagnostics during error recovery. Wrapped database writes in transactions to maintain data integrity and prevent partial state issues. Updated checks for closed database connections to enhance stability.
…llDocument. Wrapped database operations in try-catch blocks to ensure proper recovery from failures, including detailed logging for critical errors. Updated transaction management to prevent partial state issues during database writes, improving overall stability and reliability.
…nsactionWithRetry for improved resilience against SQLITE_BUSY errors during batch operations. Enhanced CodexCellDocument to manage pending index operations when the index manager is unavailable, ensuring no edits are lost during project swaps or initialization. Added logging for optimization and checkpoint operations to improve diagnostics and stability.
…ully, preventing sync operations during project swaps or deactivation. Introduced a maximum file size limit for synchronization to avoid out-of-memory errors. Improved error handling and logging for oversized files and cleanup of obsolete metadata during targeted syncs. Updated CodexCellDocument to manage index operations more effectively when the index manager is unavailable, ensuring data integrity and stability.
…nager to include try-catch blocks for improved resilience against failures. Enhanced logging for non-critical errors and added mechanisms to track error frequencies, escalating issues as needed. Updated FTS triggers in schema.ts for better data integrity and cleanup. Improved CodexCellDocument to streamline index manager refresh logic, ensuring more robust handling of index operations during project swaps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant