You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Review apps/workflows/src/lib/native-fetch.ts (new file)
Review apps/workflows/src/serve.ts changes
Review Dockerfile / dofigen config changes
Post final review
Summary
Good direction overall — switching from @libsql/client to the lower-level libsql (better-sqlite3-compatible) driver to avoid the Object.defineProperty row-rebuilding overhead, and shimming window so google-gax picks native fetch instead of node-fetch, are both sound, well-reasoned perf fixes for the Deno runtime. The comments explaining why (CPU cost on V8, @t3-oss/env's "Deno" in window check) are exactly the kind of non-obvious context worth keeping.
🐛 Likely type error: syncUrl missing from ReplicaOptions
The comment above states libsql's typings are better-sqlite3-derived and omit the embedded-replica options — that's why authToken and syncPeriod were added to the intersection. But syncUrl was left out of ReplicaOptions, even though it's used in the object literal on line 21. Since Database.Options (better-sqlite3-derived) has no syncUrl field either, this object literal assigned directly to const options: ReplicaOptions should trip TypeScript's excess-property check ("Object literal may only specify known properties, and 'syncUrl' does not exist in type 'ReplicaOptions'").
This isn't just a lint nit — both compile paths for this app type-check:
apps/workflows/package.json:4: "check": "deno check --sloppy-imports src/serve.ts", run repo-wide via pnpm check → turbo run check (.github/workflows/check.yml).
apps/workflows/Dockerfile:78: deno bundle (no --no-check flag — only the later deno compile step at line 79 skips checking).
So as written this looks like it would fail both CI's check job and the Docker image build. Fix: add syncUrl?: string; to the ReplicaOptions intersection alongside authToken and syncPeriod.
@libsql/client is still listed as a direct dependency in apps/workflows/package.json:11 and still referenced in the Dockerfile/dofigen --external flags, but db.ts no longer imports it anywhere in apps/workflows/src (only mentioned in a comment now). Worth double-checking whether it's still needed transitively (e.g. by drizzle-orm's optional peer deps) — if not, it and its dofigen sidecar entry could be dropped in a follow-up, though I wouldn't block this PR on it.
Verification note
I wasn't able to run pnpm install / deno check / a Docker build in this sandbox (commands beyond read-only git operations required interactive approval that wasn't available), so the syncUrl finding is based on static analysis of the type declarations rather than a reproduced compiler error — worth confirming with a local deno check before merging.
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
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.
Uh oh!
There was an error while loading. Please reload this page.