Skip to content

gemini catch to trust#400

Merged
khaliqgant merged 4 commits into
mainfrom
trust-gemini
Feb 11, 2026
Merged

gemini catch to trust#400
khaliqgant merged 4 commits into
mainfrom
trust-gemini

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment on lines +76 to +79
private hasNodeSqlite(): boolean {
const major = parseInt(process.versions.node.split('.')[0], 10);
return major >= 22;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 hasNodeSqlite() checks only major version, not minor, despite comment stating Node 22.5+ requirement

The hasNodeSqlite() method only checks major >= 22 but the comment and inline documentation explicitly state that node:sqlite requires Node 22.5+. On Node 22.0 through 22.4, node:sqlite is not available, yet this method returns true.

Root Cause and Impact

The method at packages/storage/src/sqlite-adapter.ts:76-79 says:

/** node:sqlite is only available in Node 22.5+ */
private hasNodeSqlite(): boolean {
  const major = parseInt(process.versions.node.split('.')[0], 10);
  return major >= 22;
}

This is used in init() at line 123 (const canUseNodeSqlite = this.hasNodeSqlite()) to decide whether to include the node driver in attempts and whether to filter it out (lines 135, 139-141). On Node 22.0–22.4, canUseNodeSqlite is incorrectly true, so 'node' is included in the attempts list and NOT filtered out.

The same incorrect pattern is replicated in the test file at packages/storage/src/sqlite-adapter.test.ts:19-22 and line 25, where tests use major >= 22 to decide whether to skip node:sqlite–related tests.

Impact: On Node 22.0–22.4, the adapter will attempt to load node:sqlite (which doesn't exist), trigger an error log ([storage] SQLite driver "node" failed: ...), and fall back to the next driver. The try/catch in openDatabase prevents a crash, but this produces confusing error output. In the test file, the 'can force node sqlite driver' test would not be skipped and would fail on those versions.

Suggested change
private hasNodeSqlite(): boolean {
const major = parseInt(process.versions.node.split('.')[0], 10);
return major >= 22;
}
/** node:sqlite is only available in Node 22.5+ */
private hasNodeSqlite(): boolean {
const [majorStr, minorStr] = process.versions.node.split('.');
const major = parseInt(majorStr, 10);
const minor = parseInt(minorStr, 10);
return major > 22 || (major === 22 && minor >= 5);
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@khaliqgant khaliqgant merged commit 61e9878 into main Feb 11, 2026
32 checks passed
@khaliqgant khaliqgant deleted the trust-gemini branch February 11, 2026 11:29
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