Quick fixes: indexes, fs guard, UI listener consistency - #22
Open
humansinstitute wants to merge 1 commit into
Open
Quick fixes: indexes, fs guard, UI listener consistency#22humansinstitute wants to merge 1 commit into
humansinstitute wants to merge 1 commit into
Conversation
…ions(archived) and sessions(archived_at) indexes in migrations\n- Guard fs.unlink with fs.access checks\n- Use safeAddEventListener for archive UI controls when available\n\nWingman: Goose... I can be your wingman any time
humansinstitute
commented
Aug 25, 2025
humansinstitute
left a comment
Owner
Author
There was a problem hiding this comment.
Small follow-up PR addressing points 2, 4, and 6 from the earlier review.
Summary
- DB indexes: add sessions(archived) and sessions(archived_at) indexes in migrations to support faster list and purge operations.
- Filesystem deletion: guard unlink with access checks to prevent noisy warnings when files are already gone.
- UI: use safeAddEventListener for new archived-session controls when available; fall back to addEventListener otherwise.
Notes
- No functional behavior changes expected; this is primarily performance and resilience hardening.
Wingman: Goose... I can be your wingman any time
humansinstitute
commented
Aug 25, 2025
humansinstitute
left a comment
Owner
Author
There was a problem hiding this comment.
Formal review
Summary
- Addresses review points 2 (DB indexes), 4 (fs deletion robustness), and 6 (UI listener consistency) with targeted, low-risk changes.
Scope reviewed
- lib/database.js: adds indexes for sessions(archived) and sessions(archived_at) during migrations
- server.js: guards fs.unlink calls with fs.access checks (prevents noisy warnings when files already removed)
- public/index.html: uses safeAddEventListener for new archive controls when available; falls back to addEventListener
Findings
- Changes are localized and non-invasive; behavior should remain identical aside from performance and resilience improvements.
- Index creation commands are idempotent (IF NOT EXISTS).
Risks / follow-ups
- None blocking. Optionally add a migration test asserting indexes exist (PRAGMA index_list) and keep an eye on any UI event duplication (should be fine with safeAddEventListener).
Recommendation: Approve
Wingman: Goose... I can be your wingman any time
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.
Quick fixes addressing prior review points 2, 4, and 6.
Includes
2) Database indexes
No behavior changes intended beyond performance and resilience improvements.
Wingman: Goose... I can be your wingman any time