Skip to content

feat: project history from operations#167

Open
Egge21M wants to merge 8 commits into
masterfrom
feat/history-refactor
Open

feat: project history from operations#167
Egge21M wants to merge 8 commits into
masterfrom
feat/history-refactor

Conversation

@Egge21M
Copy link
Copy Markdown
Collaborator

@Egge21M Egge21M commented May 8, 2026

This pull request updates Coco history so wallet activity is projected from send, melt, mint, and receive operation repositories instead of being maintained through a mutable history table.

Problem

History entries could drift from the canonical operation state because services wrote and updated separate history rows. The refactor makes operation repositories authoritative while preserving legacy history rows as read-only compatibility entries during migration.

Summary

  • Reworks core history models, HistoryService, and repository contracts around operation-backed projections with deterministic type:operationId ids, source, updatedAt, and legacy legacy:* ids.
  • Updates memory, IndexedDB, Expo SQLite, SQLite3, and SQLite Bun history repositories to merge operation rows with legacy rows, dedupe migrated activity, and preserve pagination ordering.
  • Adds focused core and adapter tests, migration docs, and a major changeset for the published packages.
  • Compatibility risk: this changes public history entry shape, history ids, repository contracts, persisted-data read behavior, and migration semantics.

Verification

  • git diff --check dd5c7551b114e144ef9e94ac12eb42e0c2c81f79..HEAD

Not run in this handoff: package test suites/typechecks.

Changeset

  • Added .changeset/project-history-from-operations.md with major bumps for core, React, adapters, and adapter tests.

@github-project-automation github-project-automation Bot moved this to Backlog in coco May 8, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: e08e87f

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

This PR includes changesets to release 7 packages
Name Type
@cashu/coco-core Major
@cashu/coco-react Major
@cashu/coco-indexeddb Major
@cashu/coco-expo-sqlite Major
@cashu/coco-sqlite Major
@cashu/coco-sqlite-bun Major
@cashu/coco-adapter-tests Major

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

@Egge21M Egge21M marked this pull request as ready for review May 8, 2026 11:59
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 92.60355% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.13%. Comparing base (dd5c755) to head (e08e87f).

Files with missing lines Patch % Lines
packages/core/models/History.ts 90.12% 16 Missing ⚠️
...ore/repositories/memory/MemoryHistoryRepository.ts 95.83% 4 Missing ⚠️
packages/core/services/HistoryService.ts 92.45% 4 Missing ⚠️
...itories/memory/MemoryReceiveOperationRepository.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   79.84%   81.13%   +1.29%     
==========================================
  Files         108      110       +2     
  Lines       11783    11908     +125     
==========================================
+ Hits         9408     9662     +254     
+ Misses       2375     2246     -129     
Flag Coverage Δ
core-integration 61.12% <ø> (-0.24%) ⬇️
core-unit 83.00% <92.60%> (+1.77%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant