Skip to content

v4.2.0

Latest

Choose a tag to compare

@craftzdog craftzdog released this 11 Jun 06:02

Highlights

Attachment replication, compaction, and error reporting now work correctly on-device — validated by the upstream PouchDB conformance suite (core + attachments + replication) running in the example app on both iOS and Android.

Bug fixes

  • web_sql_went_bad: unknown masking a SQLite UNIQUE constraint failed (#77). op-sqlite v16 reports UNIQUE violations as a plain Error with no e.code, so they slipped through as a generic unknown. They're now detected and mapped to the right PouchDB error — e.g. a clashing _local write returns 409 REV_CONFLICT.
  • Attachment replication (#3962). Pull replication delivers attachments as React Native Blobs; they're now normalized to Buffer before hashing/storage, so binary and multi-attachment replication works.
  • Multi-attachment puts: dedupe attachment digests per revision, so two attachments sharing the same content no longer violate the (digest, seq) index.
  • Compaction: reclaim orphaned attachment rows (and fix a missing await), so a stub referencing a since-compacted attachment correctly returns 412.
  • auto_compaction is no longer forced to false — the option is respected again (db.info, revs_limit).
  • Correct binary-attachment storage (stored as a BLOB) and transaction error propagation.

Note on error handling: errors that previously surfaced as web_sql_went_bad / unknown now surface as proper PouchDB errors (REV_CONFLICT 409, MISSING_STUB 412). If your code branches on those error types, review it.

Other

  • Bump @op-engineering/op-sqlite to 16.2.0.
  • Add an on-device PouchDB conformance test suite (chai + mocha) to the example app.
  • README: document the required Metro Node-build config (for attachments) and the Hermes design-doc view/filter caveat (write map/filter functions as string literals).

Full Changelog: v4.1.3...v4.2.0