Skip to content

PE-9205: Remove the unused sqlite3.wasm from the web build - #2264

Merged
vilenarios merged 1 commit into
devfrom
remove-dead-sqlite3-wasm
Oct 14, 2026
Merged

vilenarios merged 1 commit into
devfrom
remove-dead-sqlite3-wasm

Conversation

@vilenarios

Copy link
Copy Markdown
Collaborator

web/sqlite3.wasm (1,348,108 bytes) ships in every deployment, and nothing loads it. Production serves it today at app.ardrive.io/sqlite3.wasm.

How that was established

  • No tracked file names it.
  • Nothing in the dependency tree can request it. Searching every locked dependency, only package:drift/wasm.dart and package:sqlite3/wasm.dart name it, and nothing in lib/, packages/ or test/ imports either. The web database is WebDatabase from package:drift/web.dart (lib/models/database/web.dart), which runs on sql.js and loads sql-wasm.wasm.
  • The compiled app does not reference it. A release build of dev with production's flags produces a main.dart.js with zero references to sqlite3.wasm. The same build contains the one reference to worker.js, which shows the check finds a real reference when one exists.

No visitor downloads it, because nothing requests it, so this is deploy weight rather than page weight: each release uploads it, including the copy production publishes to Arweave.

Why web/worker.js stays

From inside this repo, worker.js looks equally dead. It is not. ardrive_http runs requests through the isolated_worker package, which spawns Worker('worker.js') from the web root at runtime (isolated_worker-0.1.1/lib/src/isolated_worker_web_impl.dart:48). Deleting it would break HTTP on web. An earlier note on #2196 had both files as unreferenced, from a search that covered this repo and not its dependencies.

Interaction with #2197

#2197 replaces this file with a sqlite3.wasm built for the right ABI, because the SQLite drive state artifact needs one. When #2197 is rebased onto dev it will see a modify/delete conflict on this path, resolved by keeping #2197's version. This change is still right for dev in the meantime: the file it removes cannot load under the resolved sqlite3: 2.4.2.

🤖 Generated with Claude Code

https://claude.ai/code/session_017NRgRqqrM4sg2EeqbGJzff

web/sqlite3.wasm (1,348,108 bytes) ships in every deployment and
nothing loads it.

- No tracked file names it.
- In the whole dependency tree only package:drift/wasm.dart and
  package:sqlite3/wasm.dart do, and nothing imports either. The web
  database is WebDatabase from package:drift/web.dart, which runs on
  sql.js and loads sql-wasm.wasm.
- A release build of dev compiles to a main.dart.js with no reference
  to it, while the same build does reference worker.js, which shows the
  check finds a real reference when there is one.

No visitor downloads it, because nothing requests it, so this is deploy
weight rather than page weight: every release uploads it, including the
copy production publishes to Arweave.

web/worker.js stays. It looked equally dead from inside this repo, but
ardrive_http runs requests through the isolated_worker package, which
spawns Worker('worker.js') from the web root at runtime
(isolated_worker_web_impl.dart:48). Deleting it would break HTTP on web.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NRgRqqrM4sg2EeqbGJzff
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 1
  • web/sqlite3.wasm is excluded by !**/*.wasm

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration
  • Configuration used: Repository: ardriveapp/ardrive-web/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 85473634-4b52-4e04-a5fe-f8c20d3db5df

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit d1346e7):

https://ardrive-web--pr2264-remove-dead-sqlite3-pz8qyqn7.web.app

(expires Wed, 21 Oct 2026 04:59:31 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0

@vilenarios
vilenarios merged commit bc9d050 into dev Oct 14, 2026
7 checks passed
@vilenarios
vilenarios deleted the remove-dead-sqlite3-wasm branch October 14, 2026 12:39
vilenarios added a commit that referenced this pull request Oct 14, 2026
…lite

165 commits of dev, six conflicts resolved by hand.

- web/sqlite3.wasm: kept this branch's 697,758-byte build. Dev deleted
  the old, wrong-ABI file in #2264; the WASM database here needs the
  matching one.
- sync_progress.dart: both sides add fields. Kept examinedDriveIds and
  dev's five progress counters, in the constructor and in copyWith.
- sync_cubit.dart: kept this branch's per-drive skip ledger
  (_skipsByExaminedDrive) in place of dev's single
  _lastSyncSkippedEntityTxIdsByDrive, kept dev's _publishProgress and
  _emitIfOpen, and kept both flags in both sync methods: reachedTheEnd
  feeds the ledger, ranToCompletion feeds dev's sync history. All nine of
  dev's _recordSyncRun calls survive.
- sync_repository.dart: examinedDriveIds is announced through dev's
  syncProgressController.raise, which only ever copies a progress, so the
  field survives. _syncDrive takes both syncDeep and dev's
  onMetadataFetchProgress, and both sync paths pass both.
- new_button.dart: dev's restructured New menu, with this branch's gated
  Publish Drive State entry. Item counts match dev's exactly.
- drive_detail_page.dart: dev's restructured overflow menu, with the
  gated Publish Drive State item re-inserted after Create Snapshot.

Tests adapted to APIs dev changed since this branch was cut:
driveIdsToRetry is onlyDriveIds; DriveDao.initVaults became private and
automatic, so the explicit calls go; createDriveEntityHistoryFromTransactions
takes onEntityFetched, which the composition test's stub did not match;
and dev's New menu test now provides the ConfigService the publish entry
reads, with the feature off as it ships.

flutter analyze: no issues. Full suite: 3024 passed, 5 skipped, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NRgRqqrM4sg2EeqbGJzff
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