Skip to content

Make RaindexClient Send+Sync on native targets#2489

Merged
findolor merged 11 commits intomainfrom
2026-03-03-raindex-client-send-sync
Mar 5, 2026
Merged

Make RaindexClient Send+Sync on native targets#2489
findolor merged 11 commits intomainfrom
2026-03-03-raindex-client-send-sync

Conversation

@findolor
Copy link
Copy Markdown
Collaborator

@findolor findolor commented Mar 3, 2026

Dependent PRs

Motivation

Following the local DB refactor in #2488, RaindexClient and its dependency graph (LocalDb, LocalDbState, LocalDbQueryExecutor) still used Rc/RefCell everywhere, making them !Send + !Sync on native targets. This blocks using RaindexClient across threads in CLI/server contexts.

Solution

1. LocalDbQueryExecutor trait — conditional Send bound

The trait now uses async_trait(?Send) on WASM and async_trait (with Send) on native, via #[cfg_attr].

2. LocalDbArc-based internals on native

  • FnPtr<T> alias: Rc<T> on WASM, Arc<T> on native
  • Function pointer types (ExecuteBatchFn, etc.) require Send + Sync on native
  • Two impl LocalDb blocks with platform-appropriate bounds

3. LocalDbState — thread-safe fields on native

  • db field: Rc<RefCell<...>> on WASM, Arc<Mutex<...>> on native
  • scheduler field: same split
  • Poison-safe lock access throughout (.ok(), if let Ok(...), .unwrap_or(false))

4. ClientRef type alias

  • Rc<RaindexClient> on WASM, Arc<RaindexClient> on native
  • Used across all data sources (orders, vaults, trades, add_orders, remove_orders)

5. WASM export isolation

  • clear_tables_wasm and get_sync_status moved into #[cfg(target_family = "wasm")] mod wasm blocks
  • JsCallbackExecutor module gated to WASM-only

6. Test updates

  • All LocalDbQueryExecutor mock impls updated with async_trait cfg gate
  • RefCellMutex, RcArc in test code

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Improvements
    • Enhanced WebAssembly support with platform-optimized execution paths for browser and non-browser environments
    • Improved thread safety in database query execution across different deployment targets
    • Refactored local database state management with better performance characteristics per platform
    • Updated database module architecture for improved maintainability and efficiency

findolor added 6 commits March 3, 2026 15:40
- Conditionally use async_trait(?Send) for WASM, async_trait for native
  on LocalDbQueryExecutor trait
- Add FnPtr<T> alias (Rc on WASM, Arc on native) for LocalDb internals
- Split LocalDb::new into WASM and native impl blocks with correct bounds
- Add ClientRef type alias (Rc on WASM, Arc on native)
- Gate JsCallbackExecutor module and impl to WASM-only
- Split db/scheduler fields: Rc<RefCell<...>> on WASM, Arc<Mutex<...>> on native
- Split LocalDbState::new into per-target impl blocks
- Use poison-safe lock access (ok()/if-let) in db(), mark_ready(),
  is_ready(), and Drop impl
- Replace Rc::new/Rc::clone with ClientRef::new/ClientRef::clone
- Update OrdersDataSource, VaultsDataSource traits to use async_trait
  cfg gate
- Update LocalDbOrders, LocalDbVaults to accept ClientRef
- Update RaindexOrder, RaindexVault to store ClientRef
- Move clear_tables_wasm into #[cfg(target_family = "wasm")] mod wasm
- Move get_sync_status into #[cfg(target_family = "wasm")] mod wasm
- Keep core logic functions ungated for both targets
- Apply async_trait cfg gate to all LocalDbQueryExecutor test impls
- Replace RefCell with Mutex in test executors
- Replace Rc with Arc in test code
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a961d795-cc3b-44bc-abe8-9e1a2b95d2bd

📥 Commits

Reviewing files that changed from the base of the PR and between 5c78970 and 244b24c.

📒 Files selected for processing (9)
  • crates/common/src/raindex_client/add_orders.rs
  • crates/common/src/raindex_client/local_db/mod.rs
  • crates/common/src/raindex_client/local_db/state.rs
  • crates/common/src/raindex_client/local_db/vaults.rs
  • crates/common/src/raindex_client/mod.rs
  • crates/common/src/raindex_client/orders.rs
  • crates/common/src/raindex_client/remove_orders.rs
  • crates/common/src/raindex_client/trades.rs
  • crates/common/src/raindex_client/vaults.rs

Walkthrough

This PR introduces comprehensive wasm vs non-wasm target specialization across the local database and raindex client code. Key changes include: conditional async_trait macro application via cfg_attr attributes, introduction of a ClientRef type alias abstracting pointer types (Rc on wasm, Arc on non-wasm), per-target concurrency primitives (RefCell/Mutex), and relocation of wasm-specific exports into cfg-gated modules.

Changes

Cohort / File(s) Summary
Async Trait Conditional Compilation
crates/cli/src/commands/local_db/pipeline/bootstrap.rs, crates/common/src/local_db/query/executor.rs, crates/common/src/local_db/executor.rs, crates/common/src/local_db/pipeline/adapters/... (apply, bootstrap, tokens, window)
Replace #[async_trait(?Send)] with conditional cfg_attr attributes: #[cfg_attr(target_family = "wasm", async_trait(?Send))] for wasm and #[cfg_attr(not(target_family = "wasm"), async_trait)] for non-wasm targets.
Test Harness RefCell → Mutex Migration
crates/common/src/local_db/export.rs, crates/common/src/local_db/pipeline/engine.rs
Replace RefCell-based shared state with Mutex for thread-safe storage; update access patterns from borrow()/borrow_mut() to lock().unwrap(). Adjust trait implementation attributes for wasm/non-wasm compatibility.
ClientRef Type Abstraction
crates/common/src/raindex_client/mod.rs
Introduce new ClientRef type alias: Rc<RaindexClient> for wasm, Arc<RaindexClient> for non-wasm; replace non-wasm scheduler storage from Rc<RefCell<>> to Arc<Mutex<>>. Provides single abstraction point for target-specific ownership models.
ClientRef Propagation in Orders & Vaults
crates/common/src/raindex_client/orders.rs, crates/common/src/raindex_client/vaults.rs, crates/common/src/raindex_client/local_db/orders.rs, crates/common/src/raindex_client/local_db/vaults.rs, crates/common/src/raindex_client/add_orders.rs, crates/common/src/raindex_client/remove_orders.rs, crates/common/src/raindex_client/trades.rs
Replace Rc<RaindexClient> with ClientRef throughout struct fields, constructors, and method parameters; update all clone/initialization sites to use ClientRef::clone and ClientRef::new.
Per-Target Concurrency in LocalDbState
crates/common/src/raindex_client/local_db/state.rs
Introduce target-specific storage: wasm uses Rc<RefCell<>> for db and scheduler, non-wasm uses Arc<Mutex<>> and Arc<RwLock<>> respectively. Implement separate constructors, accessors, and Drop logic per target; adjust SyncReadiness with corresponding locking semantics.
Wasm-Specific Function Type Aliases & Pointer Wrapper
crates/common/src/raindex_client/local_db/mod.rs
Define conditional type aliases for async function pointers (ExecuteBatchFn, QueryTextFn, etc.) with wasm (no Send/Sync) vs non-wasm (Send + Sync) bounds. Introduce FnPtr<T> macro abstracting Rc<T> (wasm) and Arc<T> (non-wasm); refactor LocalDb fields and constructors to use FnPtr wrapper; add wasm-specific from_js_callback constructor and public executor module.
LocalDbQueryExecutor Conditional Compilation in Raindex Paths
crates/common/src/raindex_client/local_db/executor.rs, crates/common/src/raindex_client/local_db/pipeline/bootstrap.rs, crates/common/src/raindex_client/local_db/pipeline/runner/mod.rs, crates/common/src/raindex_client/local_db/pipeline/runner/scheduler/native.rs
Gate JsCallbackExecutor impl with #[cfg(target_family = "wasm")]; apply conditional async_trait cfg_attr attributes to test impls for wasm/non-wasm compatibility.
Wasm Module Restructuring
crates/common/src/raindex_client/local_db/query/clear_tables.rs, crates/common/src/raindex_client/local_db/query/fetch_last_synced_block.rs
Move wasm-exported functions (clear_tables_wasm, get_sync_status) from crate root into cfg-gated wasm modules; adjust imports and test fixtures accordingly.

Sequence Diagram(s)

[No sequence diagrams generated; changes are primarily architectural refactoring and conditional compilation adjustments affecting trait implementations and ownership models rather than introducing new multi-component interaction flows.]

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Substantial scope spanning 40+ files with heterogeneous changes including: target-specific type abstractions (ClientRef, FnPtr), per-target concurrency primitives (RefCell/Mutex/RwLock), new conditional compilation patterns throughout, public API signature updates in multiple places, and non-trivial architectural decisions for wasm vs non-wasm specialization. Each file cohort requires separate reasoning for correctness of target-specific logic and proper abstraction usage.

Possibly related PRs

Suggested reviewers

  • hardyjosh
  • 0xgleb
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Make RaindexClient Send+Sync on native targets' directly and clearly summarizes the main objective of the changeset, which involves making RaindexClient Send+Sync on native targets through platform-conditional trait bounds and pointer types.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2026-03-03-raindex-client-send-sync

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.

@findolor
Copy link
Copy Markdown
Collaborator Author

findolor commented Mar 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 3, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/common/src/raindex_client/local_db/mod.rs (1)

337-340: ⚠️ Potential issue | 🔴 Critical

Fix WASM test compile failure from missing RaindexClient import.

Line [391] uses RaindexClient without bringing it into scope, matching the current CI error.
Line [338] also has an unused TimeoutFuture import warning.

Suggested patch
 #[cfg(all(test, target_family = "wasm", feature = "browser-tests"))]
 mod wasm_tests {
     use super::*;
-    use gloo_timers::future::TimeoutFuture;
+    use crate::raindex_client::RaindexClient;
     use rain_orderbook_app_settings::spec_version::SpecVersion;

Also applies to: 391-393

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/common/src/raindex_client/local_db/mod.rs` around lines 337 - 340, Add
a missing import for RaindexClient and remove the unused TimeoutFuture import:
bring RaindexClient into scope (e.g., add a use statement referencing
RaindexClient so the code that references RaindexClient at lines ~391–393
compiles), and delete the unused use gloo_timers::future::TimeoutFuture; line
(or gate it behind a wasm-only cfg if it will be used conditionally) to silence
the unused-import warning.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/common/src/raindex_client/local_db/state.rs`:
- Around line 91-96: The code currently swallows poisoned Mutex locks (e.g., in
the db() accessor and the other lock sites referenced) by mapping .lock().ok()
to None/false; instead recover the inner guard from a poisoned lock so local DB
routing and cleanup remain deterministic. Replace .lock().ok().and_then(|guard|
guard.as_ref().cloned()) with lock handling that matches on self.db.lock(): on
Ok(guard) use guard.as_ref().cloned(); on Err(poisoned) call
poisoned.into_inner() and then guard.as_ref().cloned(); apply the same pattern
to the other mutex accesses (the places around the other boolean/guard checks in
the file) so that poison does not silently fall back to subgraph or skip
scheduler stop. Ensure the logic still clones/returns LocalDb (or boolean) as
before after recovering the inner guard.

---

Outside diff comments:
In `@crates/common/src/raindex_client/local_db/mod.rs`:
- Around line 337-340: Add a missing import for RaindexClient and remove the
unused TimeoutFuture import: bring RaindexClient into scope (e.g., add a use
statement referencing RaindexClient so the code that references RaindexClient at
lines ~391–393 compiles), and delete the unused use
gloo_timers::future::TimeoutFuture; line (or gate it behind a wasm-only cfg if
it will be used conditionally) to silence the unused-import warning.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48b4d4d and 5c78970.

📒 Files selected for processing (26)
  • crates/cli/src/commands/local_db/pipeline/bootstrap.rs
  • crates/common/src/local_db/executor.rs
  • crates/common/src/local_db/export.rs
  • crates/common/src/local_db/pipeline/adapters/apply.rs
  • crates/common/src/local_db/pipeline/adapters/bootstrap.rs
  • crates/common/src/local_db/pipeline/adapters/tokens.rs
  • crates/common/src/local_db/pipeline/adapters/window.rs
  • crates/common/src/local_db/pipeline/engine.rs
  • crates/common/src/local_db/query/executor.rs
  • crates/common/src/raindex_client/add_orders.rs
  • crates/common/src/raindex_client/local_db/executor.rs
  • crates/common/src/raindex_client/local_db/mod.rs
  • crates/common/src/raindex_client/local_db/orders.rs
  • crates/common/src/raindex_client/local_db/pipeline/bootstrap.rs
  • crates/common/src/raindex_client/local_db/pipeline/runner/mod.rs
  • crates/common/src/raindex_client/local_db/pipeline/runner/scheduler/native.rs
  • crates/common/src/raindex_client/local_db/query/clear_tables.rs
  • crates/common/src/raindex_client/local_db/query/fetch_last_synced_block.rs
  • crates/common/src/raindex_client/local_db/state.rs
  • crates/common/src/raindex_client/local_db/vaults.rs
  • crates/common/src/raindex_client/mod.rs
  • crates/common/src/raindex_client/orders.rs
  • crates/common/src/raindex_client/remove_orders.rs
  • crates/common/src/raindex_client/trades.rs
  • crates/common/src/raindex_client/vaults.rs
  • crates/js_api/src/registry.rs

Comment thread crates/common/src/raindex_client/local_db/state.rs
findolor added 2 commits March 4, 2026 13:20
Replace .ok() / unwrap_or(false) lock handling with into_inner() so that
a poisoned Mutex/RwLock returns the correct value rather than falling back
to subgraph or skipping scheduler cleanup.
The wasm_tests module used RaindexClient without importing it, causing
a build failure under the browser-tests feature flag.
Resolve conflicts from merging 2026-03-03-raindex-client-localdb-refactor:
- Combine 3-arg RaindexClient::new() signature with Arc<Mutex> wrappers
- Keep native Arc<Mutex> scheduler initialization
- Remove unused RaindexClient import in local_db/mod.rs
- Remove duplicate get_raindex_client_native in favor of upstream get_raindex_client
Base automatically changed from 2026-03-03-raindex-client-localdb-refactor to main March 5, 2026 12:21
@findolor findolor merged commit cc08e14 into main Mar 5, 2026
19 checks passed
@findolor findolor deleted the 2026-03-03-raindex-client-send-sync branch March 5, 2026 14:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 5, 2026

Tip

For best results, initiate chat on the files or code changes.

SIZE=L


🧠 Learnings used
Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:42.275Z
Learning: For PR `#1884`, after each commit review, I should provide a new comment with a PR size report in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding irrelevant files such as lock files (package-lock.json, cargo.lock, etc.).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:42.275Z
Learning: After each commit in PR `#1884`, I should provide a new comment with the PR size report in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`. The report should exclude irrelevant files such as lock files (e.g., package-lock.json, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:25:47.873Z
Learning: After each new commit review for rainlanguage/rain.orderbook repository, generate a PR size report in a separate comment with the format: "TOTAL=number ADDITIONS=number DELETIONS=number". This report should exclude irrelevant files such as lock files (e.g., package-lock.json, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:25:47.873Z
Learning: After each new commit review for rainlanguage/rain.orderbook repository, generate a PR size report in a separate comment with the exact format: "TOTAL=number\nADDITIONS=number\nDELETIONS=number". This report should exclude irrelevant files such as lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any additional text or formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T22:46:08.530Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, the PR size report should be the only content in the comment - no text before it, no text after it, no formatting blocks, just the raw report in the exact format: "TOTAL=number\nADDITIONS=number\nDELETIONS=number". The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1971
File: .github/workflows/vercel-docs-prod.yaml:32-34
Timestamp: 2025-07-11T12:30:09.245Z
Learning: findolor prefers not to pin Node versions explicitly in GitHub Actions workflows when using Nix with webapp-shell, considering the current setup sufficient for deterministic builds in the rainlanguage/rain.orderbook project.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1971
File: .github/workflows/vercel-docs-prod.yaml:10-14
Timestamp: 2025-07-11T12:29:49.284Z
Learning: In GitHub Actions workflows for the rainlanguage/rain.orderbook project, findolor is comfortable with job names that may seem misleading (like "Deploy-Docs-Preview" in a production workflow) when there's only one job in the workflow, as the context makes it clear enough.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1913
File: Cargo.toml:55-55
Timestamp: 2025-06-06T16:38:04.182Z
Learning: In rain.orderbook repository, during PR chains involving dependency updates, wasm-bindgen-utils may temporarily point to git commits that don't contain the full required functionality, with the understanding that subsequent PRs in the chain will update it to the correct commit.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2202
File: crates/common/src/raindex_client/local_db/sync.rs:33-34
Timestamp: 2025-10-14T07:51:55.148Z
Learning: In `crates/common/src/raindex_client/local_db/sync.rs`, the hard-coded `DEFAULT_SYNC_CHAIN_ID` constant (set to `SUPPORTED_LOCAL_DB_CHAINS[0]`) will be replaced with proper chain ID handling in downstream PRs as part of the multi-network/orderbook implementation.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR `#1884` in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1994
File: crates/common/src/raindex_client/vaults.rs:282-292
Timestamp: 2025-07-15T08:01:38.534Z
Learning: In the rainlanguage/rain.orderbook codebase, findolor prefers to avoid concurrency optimizations like using `futures::future::try_join_all` for parallel processing of balance changes, considering such optimizations "not that critical at the moment" when the performance impact is minimal.

Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: crates/js_api/src/filters/raindex_filter_store.rs:446-533
Timestamp: 2025-08-02T02:34:32.237Z
Learning: In the rainlanguage/rain.orderbook project's RaindexFilterStore WASM tests (crates/js_api/src/filters/raindex_filter_store.rs), brusherru decided to focus on testing only methods without side effects (that don't use web_sys) due to difficulties with mocking localStorage and window APIs in the WASM test environment. This pragmatic approach tests pure logic separately from browser integration.

Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2000
File: crates/common/src/raindex_client/vaults.rs:183-183
Timestamp: 2025-07-16T10:40:05.717Z
Learning: In the rainlanguage/rain.orderbook codebase, user findolor considers breaking changes from Option<U256> to U256 for required fields like decimals in RaindexVaultToken to be acceptable and safe, even when they affect multiple usage sites across the codebase.

Learnt from: rouzwelt
Repo: rainlanguage/rain.orderbook PR: 0
File: :0-0
Timestamp: 2025-05-21T21:26:31.566Z
Learning: For PR `#1884` and future PRs in rainlanguage/rain.orderbook repository, provide PR size reports in a separate comment with ONLY the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number", without any additional text or explanation. Reports should exclude irrelevant files such as lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

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.

2 participants