Skip to content

fix: Fix build and potential Mosaic duckdb-wasm type mismatch - #625

Merged
ilyabo merged 2 commits into
mainfrom
fix--Potential-Mosaic-duckdb-wasm-type-mismatch
May 14, 2026
Merged

ilyabo merged 2 commits into
mainfrom
fix--Potential-Mosaic-duckdb-wasm-type-mismatch

Conversation

@ilyabo

@ilyabo ilyabo commented May 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Updated internal type-checking handling in the mosaic module initialization to improve development experience.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 14, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A single type-suppression comment change in MosaicSlice.ts replaces the @ts-expect-error directive with eslint-disabled @ts-ignore directives around the duckDb: dbConnector.getDb() argument to suppress a duckdb-wasm version mismatch error during wasmConnector initialization.

Changes

Type-suppression directive update

Layer / File(s) Summary
wasmConnector type-suppression update
packages/mosaic/src/MosaicSlice.ts
The duckDb argument in the wasmConnector initialization call changes from using a @ts-expect-error suppression to eslint-disabled @ts-ignore directives with updated commentary about the duckdb-wasm version mismatch.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • sqlrooms/sqlrooms#585: Both PRs modify packages/mosaic/src/MosaicSlice.ts in the createMosaicSlice().mosaic.initialize() path—this one updates type-suppression directives for duckdb-wasm initialization, while the other applies preagg schema settings in the same function.

Poem

A rabbit hops through the TypeScript code,
Swapping @ts-expect for suppression mode,
With eslint whispers and @ts-ignore grace,
The duckdb mismatch finds its proper place! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately reflects the main change: addressing a type mismatch between Mosaic and duckdb-wasm by modifying type-checking suppression comments.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix--Potential-Mosaic-duckdb-wasm-type-mismatch

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.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
packages/mosaic/src/MosaicSlice.ts (1)

161-166: ⚡ Quick win

Use @ts-expect-error instead of @ts-ignore to prevent stale suppressions.

@ts-expect-error will fail compilation if the underlying type error is resolved, ensuring suppressions don't become stale. @ts-ignore will continue to suppress even when no error exists, potentially masking future issues.

Additionally, using eslint-disable to suppress ban-ts-comment conflicts with the lint baseline requirement of warnings only. If possible, consider whether a type assertion (e.g., as duckdb.AsyncDuckDB) would be more appropriate, though this would require verifying compatibility with Mosaic's expected types.

♻️ Switch to `@ts-expect-error`
-                  // eslint-disable-next-line `@typescript-eslint/ban-ts-comment`
-                  // `@ts-ignore` - We might be using a different version of duckdb-wasm than mosaic expects
+                  // `@ts-expect-error` - We might be using a different version of duckdb-wasm than mosaic expects
                   duckDb: dbConnector.getDb(),
-                  // eslint-disable-next-line `@typescript-eslint/ban-ts-comment`
-                  // `@ts-ignore` - same version mismatch
+                  // `@ts-expect-error` - same version mismatch
                   connection: dbConnector.getConnection(),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/mosaic/src/MosaicSlice.ts` around lines 161 - 166, Replace the two
"// `@ts-ignore`" suppressions used for duckDb: dbConnector.getDb() and
connection: dbConnector.getConnection() with "// `@ts-expect-error`" and remove
the corresponding "eslint-disable-next-line `@typescript-eslint/ban-ts-comment`"
lines so the suppression fails fast if the type issue is resolved;
alternatively, if you can confirm types, replace the ignores entirely with
explicit type assertions (e.g., cast dbConnector.getDb() to the expected
duckdb.AsyncDuckDB and dbConnector.getConnection() to the expected connection
type) and remove both the ts-comment and eslint-disable lines for cleaner,
non-stale typing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/mosaic/src/MosaicSlice.ts`:
- Around line 161-166: Replace the two "// `@ts-ignore`" suppressions used for
duckDb: dbConnector.getDb() and connection: dbConnector.getConnection() with "//
`@ts-expect-error`" and remove the corresponding "eslint-disable-next-line
`@typescript-eslint/ban-ts-comment`" lines so the suppression fails fast if the
type issue is resolved; alternatively, if you can confirm types, replace the
ignores entirely with explicit type assertions (e.g., cast dbConnector.getDb()
to the expected duckdb.AsyncDuckDB and dbConnector.getConnection() to the
expected connection type) and remove both the ts-comment and eslint-disable
lines for cleaner, non-stale typing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3db02390-7a0a-4035-9ef9-011fa4af92c2

📥 Commits

Reviewing files that changed from the base of the PR and between 4f9e7f3 and 1fd6292.

📒 Files selected for processing (1)
  • packages/mosaic/src/MosaicSlice.ts

@ilyabo ilyabo changed the title fix: Potential Mosaic duckdb-wasm type mismatch fix: Fix build and potential Mosaic duckdb-wasm type mismatch May 14, 2026
@ilyabo
ilyabo merged commit 1332308 into main May 14, 2026
4 checks passed
@ilyabo
ilyabo deleted the fix--Potential-Mosaic-duckdb-wasm-type-mismatch branch May 14, 2026 19:14
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