Skip to content

Revert Wayfinder SQLite fallback dependency - #4094

Closed
Yathusiga27 wants to merge 1 commit into
thunder-id:mainfrom
Yathusiga27:revert/wayfinder-node20-sqlite-fallback
Closed

Revert Wayfinder SQLite fallback dependency#4094
Yathusiga27 wants to merge 1 commit into
thunder-id:mainfrom
Yathusiga27:revert/wayfinder-node20-sqlite-fallback

Conversation

@Yathusiga27

@Yathusiga27 Yathusiga27 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Purpose

Revert #3963

Approach

  • Removed the better-sqlite3 fallback dependency and related SQLite adapter files.
  • Kept the Wayfinder sample on node:sqlite.
  • Added a shared Node.js version check before loading node:sqlite in both the seed script and database module.
  • Added unit tests for the supported and unsupported Node.js version boundaries.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features

    • Updated the Wayfinder sample backend to use Node.js’s built-in SQLite support.
    • Added startup compatibility checks for Node.js versions that support the required SQLite functionality.
    • Added clear upgrade guidance, including the required Node.js version and installation options.
  • Bug Fixes

    • Improved startup behavior by reporting an actionable message instead of failing unexpectedly when an unsupported Node.js version is detected.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9af095e2-45de-4fca-9542-650ef422673b

📥 Commits

Reviewing files that changed from the base of the PR and between c2e3bbf and cd67fce.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • pnpm-workspace.yaml
  • samples/apps/wayfinder-sample/backend/package.json
  • samples/apps/wayfinder-sample/backend/scripts/seed.js
  • samples/apps/wayfinder-sample/backend/src/db.js
  • samples/apps/wayfinder-sample/backend/src/node-version.js
  • samples/apps/wayfinder-sample/backend/src/node-version.test.js
  • samples/apps/wayfinder-sample/backend/src/sqlite.js
  • samples/apps/wayfinder-sample/backend/src/sqlite.test.js

📝 Walkthrough

Walkthrough

The Wayfinder sample backend now requires Node.js 22.13.0, validates node:sqlite support at startup, and loads Node’s built-in SQLite implementation directly. The better-sqlite3 fallback, dependency, build permission, adapter, and adapter tests are removed.

Changes

Wayfinder Node SQLite migration

Layer / File(s) Summary
Runtime and dependency requirements
pnpm-workspace.yaml, samples/apps/wayfinder-sample/backend/package.json
The backend requires Node.js >=22.13.0; better-sqlite3 is removed from dependencies and workspace build permissions.
Node SQLite version enforcement
samples/apps/wayfinder-sample/backend/src/node-version.js, samples/apps/wayfinder-sample/backend/src/node-version.test.js
Version utilities detect supported Node releases, provide upgrade guidance, terminate unsupported processes, and test version boundaries and message content.
Database entrypoint migration
samples/apps/wayfinder-sample/backend/src/db.js, samples/apps/wayfinder-sample/backend/scripts/seed.js, samples/apps/wayfinder-sample/backend/src/sqlite.js, samples/apps/wayfinder-sample/backend/src/sqlite.test.js
Database startup and seeding validate Node SQLite support before dynamically importing DatabaseSync from node:sqlite; the local adapter and its tests are deleted.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Backend
  participant VersionCheck
  participant NodeSQLite
  Backend->>VersionCheck: ensureNodeSqliteSupported()
  VersionCheck-->>Backend: Continue or exit with upgrade guidance
  Backend->>NodeSQLite: Import DatabaseSync
  NodeSQLite-->>Backend: Provide DatabaseSync
Loading

Possibly related PRs

Suggested reviewers: brionmario

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@Yathusiga27
Yathusiga27 force-pushed the revert/wayfinder-node20-sqlite-fallback branch 4 times, most recently from a037e01 to 6adc7a2 Compare July 17, 2026 06:36
@Yathusiga27
Yathusiga27 force-pushed the revert/wayfinder-node20-sqlite-fallback branch from 6adc7a2 to cd67fce Compare July 17, 2026 06:39
@Yathusiga27
Yathusiga27 marked this pull request as ready for review July 17, 2026 06:40
@Yathusiga27 Yathusiga27 reopened this Jul 17, 2026
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Yathusiga27
Yathusiga27 deleted the revert/wayfinder-node20-sqlite-fallback branch August 14, 2026 05:36
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