feat: Enhance SQLite path validation and add related tests#61
Merged
Yashh56 merged 3 commits intoRelwave:masterfrom Apr 9, 2026
Merged
feat: Enhance SQLite path validation and add related tests#61Yashh56 merged 3 commits intoRelwave:masterfrom
Yashh56 merged 3 commits intoRelwave:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive improvements to SQLite path handling, validation, and normalization across the codebase. The main goals are to ensure consistent storage and usage of SQLite database paths, prevent invalid configurations (such as Windows drive roots or directories), and clean up legacy, duplicated logic. The changes affect connection building, database service logic, the database store, and the SQLite connector, and are backed by expanded test coverage.
SQLite Path Normalization and Validation
normalizeSQLitePathandisWindowsDriveRootPathutilities inbridge/src/utils/sqlitePath.ts, replacing scattered and inconsistent normalization logic throughout the codebase. ([bridge/src/utils/sqlitePath.tsR1-R40](https://github.com/Relwave/relwave-app/pull/61/files#diff-dd1fb3d6c5dfb23b4d2f20417b7b63337f5bb806b79233a243a6aa4089f6aeb5R1-R40))[[1]](https://github.com/Relwave/relwave-app/pull/61/files#diff-06af935347e355c61a19972eb849674d8211cebd357d1c6bc2646870b3a84aedR199-R243),[[2]](https://github.com/Relwave/relwave-app/pull/61/files#diff-06af935347e355c61a19972eb849674d8211cebd357d1c6bc2646870b3a84aedL479-R536),[[3]](https://github.com/Relwave/relwave-app/pull/61/files#diff-06af935347e355c61a19972eb849674d8211cebd357d1c6bc2646870b3a84aedL494-R551),[[4]](https://github.com/Relwave/relwave-app/pull/61/files#diff-06af935347e355c61a19972eb849674d8211cebd357d1c6bc2646870b3a84aedL528-R589))"D:/") and directories as invalid SQLite database paths at both connection and service layers. ([[1]](https://github.com/Relwave/relwave-app/pull/61/files#diff-85d82727f94b9a6acd6571152afd7ec10436f0613046136291986d5acfa64dc4L260-R289),[[2]](https://github.com/Relwave/relwave-app/pull/61/files#diff-8d572332fcbe9619e45eee61573eefb831d0673c8bd2deebc0dec010c549711cR19-R23))Database Service and Store Enhancements
DatabaseServicenow normalizes and validates SQLite paths on both add and update operations, ensuring only valid, normalized paths are persisted. ([bridge/src/services/databaseService.tsR56-R82](https://github.com/Relwave/relwave-app/pull/61/files#diff-e45d21cda98fb517adb7c6c3804f1fea48e3dbd89ab0ea67c393adb4bffb66eeR56-R82))DbStoreclass normalizes SQLite paths both when adding/updating entries and when loading existing configuration data, ensuring legacy or pre-existing configs are corrected automatically. ([[1]](https://github.com/Relwave/relwave-app/pull/61/files#diff-06af935347e355c61a19972eb849674d8211cebd357d1c6bc2646870b3a84aedL247-R301),[[2]](https://github.com/Relwave/relwave-app/pull/61/files#diff-06af935347e355c61a19972eb849674d8211cebd357d1c6bc2646870b3a84aedL414-R486))Connector Improvements
[[1]](https://github.com/Relwave/relwave-app/pull/61/files#diff-85d82727f94b9a6acd6571152afd7ec10436f0613046136291986d5acfa64dc4L260-R289),[[2]](https://github.com/Relwave/relwave-app/pull/61/files#diff-85d82727f94b9a6acd6571152afd7ec10436f0613046136291986d5acfa64dc4L406-R407),[[3]](https://github.com/Relwave/relwave-app/pull/61/files#diff-85d82727f94b9a6acd6571152afd7ec10436f0613046136291986d5acfa64dc4L430-L457))Test Coverage
[[1]](https://github.com/Relwave/relwave-app/pull/61/files#diff-493c9899f0a20a4d9e99537b89abe1610e4754bfb987de0213715b3c36182aa5R183-R189),[[2]](https://github.com/Relwave/relwave-app/pull/61/files#diff-cf0e2775e5f7b968fbda4127e6bab4b36571cacb6836f01ba1ded5ee884217e8R101-R107),[[3]](https://github.com/Relwave/relwave-app/pull/61/files#diff-bd05993a3b08063b7fae77f1da2574ec62379872a78756627eb473978c56636dR76-R104),[[4]](https://github.com/Relwave/relwave-app/pull/61/files#diff-b35a5f89a2ec20683b2a7bfedec042dcb9ca3c40bebcaf2bd61c74004fbaf6f5R103-R111),[[5]](https://github.com/Relwave/relwave-app/pull/61/files#diff-b35a5f89a2ec20683b2a7bfedec042dcb9ca3c40bebcaf2bd61c74004fbaf6f5R352-R387))These changes collectively make SQLite handling more robust, secure, and consistent throughout the application.