Skip to content

Update WebServer.kt -fix old bug found by CodeRabbit#843

Merged
hal-eisen-adfa merged 2 commits intostagefrom
davidschachterADFA-patch-1
Jan 16, 2026
Merged

Update WebServer.kt -fix old bug found by CodeRabbit#843
hal-eisen-adfa merged 2 commits intostagefrom
davidschachterADFA-patch-1

Conversation

@davidschachterADFA
Copy link
Collaborator

@davidschachterADFA davidschachterADFA commented Jan 16, 2026

In the LastChange table, the column now was renamed to changeTime. But the logDatabaseLastChange() function wasn't updated. CodeRabbit noticed this.

Copy link
Collaborator

@hal-eisen-adfa hal-eisen-adfa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Release Notes - PR #843

Changes

  • Updated logDatabaseLastChanged() function in WebServer.kt to query the changeTime column instead of the deprecated now column from the LastChange table
  • Aligns WebServer.kt with database schema changes where the LastChange table column was renamed from now to changeTime

Risks & Best Practices Considerations

  • ⚠️ Schema Compatibility: This change requires the database schema to have the renamed column changeTime. Ensure all database instances are updated before deploying this code change to avoid SQL errors.
  • ℹ️ Debug-Only Impact: The function is only executed when debugEnabled is true, limiting production impact
  • ℹ️ Error Handling: Exception handling in place with debug logging fallback if the query fails
  • ⚠️ Raw SQL Query: Function uses SQLiteDatabase.rawQuery() directly without prepared statements. While not vulnerable in this case (no user input), consider using parameterized queries for consistency with security best practices.

Walkthrough

The pull request modifies the logDatabaseLastChanged() method in WebServer.kt to fetch the changeTime column instead of the now column from the LastChange table's SELECT statement. This adjusts which timestamp is used for database change logging.

Changes

Cohort / File(s) Change Summary
WebServer timestamp column update
app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt
Modified logDatabaseLastChanged() SQL query to select changeTime column instead of now from the LastChange table

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Fix/adfa 1894 #841 — Modifies the same file to use the changeTime column in a different SQL operation (ORDER BY clause), indicating coordinated database schema usage updates.

Poem

🐰 A timestamp was confused, I say,
now and changeTime had a fray,
But this fix makes it clear,
Which moment to hold dear,
The database logs the right way! 🕐

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating WebServer.kt to fix a bug where a column reference wasn't updated after a database schema change.
Description check ✅ Passed The description clearly explains the context and reason for the change: a column rename in the LastChange table that required updating the logDatabaseLastChange() function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4cf3330 and 7e03f83.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt
🔇 Additional comments (1)
app/src/main/java/com/itsaky/androidide/localWebServer/WebServer.kt (1)

62-64: LGTM — column rename applied correctly.

Query now selects changeTime, matching the renamed column.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hal-eisen-adfa hal-eisen-adfa merged commit 383f2f8 into stage Jan 16, 2026
2 checks passed
@hal-eisen-adfa hal-eisen-adfa deleted the davidschachterADFA-patch-1 branch January 16, 2026 04:44
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.

2 participants