Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

Repro of #1922

Open dfahlander opened this issue 2 months ago • 1 comments

This PR is currently failing as it reproduces issue #1922. When the bug is solved in dexie.cloud service, please rerun the tests.

Summary by CodeRabbit

  • Tests
    • Expanded Dexie Cloud test suite with new scenarios covering open/sync/modify/validate flows
    • Added scaffolding for deterministic sync tests and improved data normalization before assertions
    • Standardized transaction callbacks and formatting for clearer, more reliable tests
    • Strengthened assertions and synchronization checks across multiple scenarios

dfahlander avatar Nov 01 '25 15:11 dfahlander

Walkthrough

Removed unused public imports from the Dexie Cloud test file and added/expanded test scaffolding that opens, syncs, modifies, and validates data (issue #1922). Also reformatted and adjusted several Dexie Cloud test sequences (issue #2185) and standardized transaction callback signatures.

Changes

Cohort / File(s) Change Summary
Import/API cleanup
addons/dexie-cloud/test/unit/tests-github-issues.ts
Removed DexieCloudOptions and getTiedRealmId from the public import surface; now imports only dexieCloud and DexieCloudTable.
Test scaffolding and formatting
addons/dexie-cloud/test/unit/tests-github-issues.ts
Added DEXIE_CLOUD_PROPS constant and a promised test exercising open→sync→modify→validate flow for issue #1922; expanded/reformatted tests for issue #2185 with consistent (tx) transaction callback parameters, trailing commas, adjusted async handling, minor test-data and assertion updates, and a runtime strip helper usage.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Test as Tests (unit)
  participant Client as dexie-cloud-client
  participant Realm as Local Realm/DB
  participant Server as Dexie Cloud Server

  Note over Test,Client: Test scaffolding opens client and triggers sync
  Test->>Client: open() / start sync
  Client->>Realm: apply local mutations (tx)
  Client->>Server: push local changes / request updates
  Server-->>Client: send remote updates / acks
  Client->>Realm: apply remote updates
  Realm-->>Test: confirm data state
  Note right of Test: Assertions and validations

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas needing extra attention:
    • The new promised test flow (open, sync, modify, validate) — verify correctness of async ordering and assertions.
    • Any implicit assumptions in the strip helper usage and commented alternate implementation.
    • Confirm that removing DexieCloudOptions and getTiedRealmId from the import reflects intended public API surface (tests compile/run without those symbols).

Poem

🐰 I hopped into tests with a curious mind,
Cleared old imports and tidied the bind.
I synced and I hopped from local to sky,
Watching data dance, then winked an eye —
Tiny rabbit cheers for tests refined! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Repro of #1922" directly and accurately describes the main change in the pull request. According to the raw summary, the primary modification is adding new test scaffolding for Dexie issue #1922, including a new test case that exercises opening, syncing, modifying, and validating data. The title is concise, clear, and specific—it references the issue number in a way that makes the purpose immediately understandable to reviewers. While the changeset includes some additional adjustments (such as test reformatting for issue #2185 and import changes), these are secondary to the main objective of reproducing issue #1922.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch issue1922

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5509f8384e6b42e4d86f028f4341177ae216e99 and 4d4dd7150f36f2f1249a9f5ce32799276dc259e0.

📒 Files selected for processing (1)
  • addons/dexie-cloud/test/unit/tests-github-issues.ts (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
addons/dexie-cloud/test/unit/tests-github-issues.ts (1)
addons/dexie-cloud/src/dexie-cloud-client.ts (1)
  • dexieCloud (76-501)

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[bot] avatar Nov 01 '25 15:11 coderabbitai[bot]