Skip to content

Perf/optimize issued list loading 17625898162927159685#21

Open
G30RG3-GJ wants to merge 11 commits intoafsalashyana:masterfrom
G30RG3-GJ:perf/optimize-issued-list-loading-17625898162927159685
Open

Perf/optimize issued list loading 17625898162927159685#21
G30RG3-GJ wants to merge 11 commits intoafsalashyana:masterfrom
G30RG3-GJ:perf/optimize-issued-list-loading-17625898162927159685

Conversation

@G30RG3-GJ
Copy link

No description provided.

google-labs-jules bot and others added 11 commits February 11, 2026 22:30
The previous implementation of `prepareIV` used `java.util.Random` seeded with `System.currentTimeMillis()`, which is predictable and insecure for cryptographic operations. This change replaces it with `java.security.SecureRandom` to generate a cryptographically strong random IV.

This fixes a security vulnerability where the IV could be predicted, potentially compromising the encryption.

Also removed unused imports:
- `java.nio.charset.StandardCharsets`
- `java.security.MessageDigest`
- `java.util.Arrays`
- `java.util.Random`

Co-authored-by: G30RG3-GJ <[email protected]>
- Modified `showErrorMessage(Exception ex, String title, String content)` to include `styleAlert(alert)`. This ensures consistent styling for this overload and fixes a missing style application.
- Modified `showErrorMessage(Exception ex)` to delegate to `showErrorMessage(Exception ex, String title, String content)`, eliminating duplicated logic for alert creation and configuration.
- Preserved existing behavior for title and header text ("Error occured" / "Error Occured").

Co-authored-by: G30RG3-GJ <[email protected]>
…3569

🔒 Fix predictable IV generation in EncryptionUtil
…tion-14676278107199138789

Refactor AlertMaker to reduce code duplication
- Refactored `DataHelper.insertNewBook` to accept `java.sql.Connection` for better testability.
- Added `DataHelperTest` using JUnit 4 and Mockito to verify SQL execution.
- Added test dependencies in `libs/test/`.
- Included stubs for `DatabaseHandler` and `MemberListController` in `test/stubs/` to enable compilation in non-JavaFX environments.
- Added `run_tests.sh` script to facilitate test execution.

Co-authored-by: G30RG3-GJ <[email protected]>
- Added JUnit 4.13.2, Hamcrest Core 1.3, and GreenMail 1.6.15 to libs/test/
- Updated nbproject/project.properties to include new test libs in classpath
- Created test/library/assistant/email/EmailUtilTest.java with integration test logic
- Verified test passes with mocked SMTP server

Co-authored-by: G30RG3-GJ <[email protected]>
…10603895794473152871

🧹 Remove unused main methods from Loader classes
…65157879989

Add integration test for EmailUtil
…16503906619777

Add test for DataHelper.insertNewBook
…ing File I/O

- Refactored `IssuedListController.loadData` to use `javafx.concurrent.Task`.
- Added `LibraryAssistantUtil.getFineAmount(int, Preferences)` to allow passing cached preferences.
- Fetched `Preferences` once per load instead of once per row, eliminating redundant file I/O.
- Validated with microbenchmark showing ~5000x speedup for the preference reading logic.

Co-authored-by: G30RG3-GJ <[email protected]>
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