Skip to content

Add reproduction for platform-browser/IndexedDbQueryBuilder issue - #6852

Merged
tim-smart merged 2 commits into
mainfrom
audit/repro-platform-browser-indexed-db-query-builder-semantics
Aug 2, 2026
Merged

Add reproduction for platform-browser/IndexedDbQueryBuilder issue#6852
tim-smart merged 2 commits into
mainfrom
audit/repro-platform-browser-indexed-db-query-builder-semantics

Conversation

@fubhy

@fubhy fubhy commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

Fix the IndexedDB query builder semantics covered by the reproduction tests:

  • preserve index and key-range constraints for limited and filtered deletes
  • abort shared transactions when their Effect fails or is interrupted, and wait for the native transaction outcome on success
  • apply reverse ordering before limits
  • keep paged select streams reusable across subscriptions
  • report NoSuchElementError for empty ranged first() queries
  • add a patch changeset for @effect/platform-browser

Covered audit issues

  • platforms-browser-indexed-db-delete-range-index
  • platforms-browser-indexed-db-transaction-failure-commits
  • platforms-browser-indexed-db-reverse-limit-order
  • platforms-browser-indexed-db-stream-offset-reuse
  • platforms-browser-indexed-db-ranged-first-error

Validation

pnpm test --run packages/platform-browser/test/IndexedDbQueryBuilder.test.ts
pnpm lint-fix
pnpm check

Closes EFF-318

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Aug 1, 2026
@changeset-bot

changeset-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e162ab2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@effect/platform-browser Patch
effect Patch
@effect/opentelemetry Patch
@effect/platform-bun Patch
@effect/platform-deno Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/docgen Patch
@effect/doctest Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-slopcop effect-slopcop Bot added the 4.0 label Aug 1, 2026

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • 5 reproduction tests for IndexedDbQueryBuilder — each targets a distinct bug: withTransaction rollback on failure, reverse-then-limit ordering, indexed range constrained delete, paged stream offset independence, and NoSuchElementError on empty ranged first().

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

@effect-slopcop effect-slopcop Bot added the bug Something isn't working label Aug 2, 2026
@tim-smart
tim-smart enabled auto-merge (squash) August 2, 2026 23:32

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Transaction lifecycle: withTransaction now aborts the native transaction on inner effect failure/interruption, and awaits transaction completion on success, piping IndexedDbQueryError into the error channel.
  • Index-keyed range deletes: applyDelete resolves the index store and passes key-range constraints to the cursor so range-restricted deletes on indexes work.
  • Reverse-limit ordering: reverse selects now force cursor-backed retrieval, so the reversed order is established before the limit cutoff.
  • Fresh select stream subscriptions: paged select streams create fresh query objects per page via makeSelect instead of mutating a shared one, and track offsets from the initial offsetValue so the stream produces identical results on each subscription.
  • Empty ranged first(): the store.get(keyRange) branch now returns Cause.NoSuchElementError for missing results, matching the cursor-backed path.
  • Delete filter fix: DeleteProto.filter spreads this into makeSelect instead of passing only this.delete, preserving range and limit constraints through filter chaining.
  • Patch changeset for @effect/platform-browser.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

@tim-smart
tim-smart merged commit ef6eca7 into main Aug 2, 2026
17 checks passed
@tim-smart
tim-smart deleted the audit/repro-platform-browser-indexed-db-query-builder-semantics branch August 2, 2026 23:56
@github-project-automation github-project-automation Bot moved this from Discussion Ongoing to Done in PR Backlog Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
basic.ts 6.65 KB 6.77 KB -0.13 KB (-1.86%)
batching.ts 9.44 KB 9.57 KB -0.13 KB (-1.38%)
brand.ts 6.33 KB 6.45 KB -0.12 KB (-1.88%)
cache.ts 10.20 KB 10.31 KB -0.11 KB (-1.11%)
config.ts 20.34 KB 20.47 KB -0.12 KB (-0.60%)
differ.ts 19.95 KB 20.08 KB -0.13 KB (-0.63%)
http-client.ts 21.04 KB 21.16 KB -0.12 KB (-0.58%)
logger.ts 10.35 KB 10.46 KB -0.12 KB (-1.11%)
metric.ts 8.58 KB 8.70 KB -0.13 KB (-1.44%)
optic.ts 7.34 KB 7.46 KB -0.12 KB (-1.59%)
pubsub.ts 14.49 KB 14.60 KB -0.12 KB (-0.80%)
queue.ts 11.15 KB 11.26 KB -0.11 KB (-0.99%)
schedule.ts 10.33 KB 10.44 KB -0.11 KB (-1.05%)
schema-class.ts 18.88 KB 19.01 KB -0.13 KB (-0.69%)
schema-fromJsonSchemaDocument.ts 28.69 KB 28.81 KB -0.12 KB (-0.42%)
schema-representation-roundtrip.ts 25.01 KB 25.14 KB -0.13 KB (-0.52%)
schema-string-transformation.ts 13.01 KB 13.12 KB -0.11 KB (-0.84%)
schema-string.ts 10.66 KB 10.79 KB -0.12 KB (-1.11%)
schema-template-literal.ts 14.87 KB 14.99 KB -0.13 KB (-0.84%)
schema-toArbitraryLazy.ts 21.67 KB 21.80 KB -0.12 KB (-0.56%)
schema-toCodeDocument.ts 24.10 KB 24.20 KB -0.11 KB (-0.44%)
schema-toCodecJson.ts 18.93 KB 19.05 KB -0.12 KB (-0.63%)
schema-toEquivalence.ts 18.74 KB 18.88 KB -0.14 KB (-0.73%)
schema-toFormatter.ts 18.61 KB 18.74 KB -0.13 KB (-0.69%)
schema-toJsonSchemaDocument.ts 22.36 KB 22.49 KB -0.14 KB (-0.61%)
schema-toRepresentation.ts 19.28 KB 19.41 KB -0.13 KB (-0.66%)
schema.ts 18.14 KB 18.26 KB -0.13 KB (-0.69%)
stm.ts 12.13 KB 12.25 KB -0.12 KB (-0.96%)
stream.ts 9.38 KB 9.49 KB -0.11 KB (-1.17%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0 bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants