Skip to content

IsolatedCompactionStrategy - #306

Open
Rexios80 wants to merge 6 commits into
mainfrom
feature/isolated-compaction-strategy
Open

IsolatedCompactionStrategy#306
Rexios80 wants to merge 6 commits into
mainfrom
feature/isolated-compaction-strategy

Conversation

@Rexios80

@Rexios80 Rexios80 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Closes #305

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses #305 by making compactionStrategy usable with IsolatedHive by replacing the non-sendable CompactionStrategy function parameter with a sendable IsolatedCompactionStrategy that can be serialized, transmitted across isolate boundaries, and rehydrated inside the Hive isolate.

Changes:

  • Introduces IsolatedCompactionStrategy (JSON-serializable) with threshold(...) and never() options and rehydrates it in the Hive isolate handler.
  • Updates IsolatedHive APIs and implementations (VM/web/stub) to accept IsolatedCompactionStrategy? instead of CompactionStrategy?.
  • Adds build.yaml configuration and updates generated files to include consistent ignore_for_file directives.

Reviewed changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
hive/lib/src/schema/hive_schema.g.dart Adds generated-file ignore directives.
hive/lib/src/isolate/isolated_hive.dart Changes compactionStrategy API type to IsolatedCompactionStrategy?.
hive/lib/src/isolate/isolated_hive_impl/impl/isolated_hive_impl_web.dart Resolves IsolatedCompactionStrategy into a real CompactionStrategy on web.
hive/lib/src/isolate/isolated_hive_impl/impl/isolated_hive_impl_vm.dart Serializes compaction strategy via toJson() when invoking isolate method calls.
hive/lib/src/isolate/isolated_hive_impl/impl/isolated_hive_impl_stub.dart Updates stub signatures to match new API type.
hive/lib/src/isolate/isolated_compaction_strategy.dart New sendable compaction strategy definition + (de)serialization and resolver.
hive/lib/src/isolate/isolated_compaction_strategy.g.dart Generated JSON serialization for the threshold strategy.
hive/lib/src/isolate/handler/isolated_hive_handler.dart Rehydrates compaction strategy JSON into an executable function in the Hive isolate.
hive/lib/src/connect/hive_connect_api.g.dart Adds generated-file ignore directives.
hive/lib/src/backend/lock_props.g.dart Adds generated-file ignore directives.
hive/lib/hive.dart Exports isolated_compaction_strategy.dart as part of the public API.
hive/build.yaml Configures generator ignore directives across generated .g.dart files.
Files not reviewed (4)
  • hive/lib/src/backend/lock_props.g.dart: Generated file
  • hive/lib/src/connect/hive_connect_api.g.dart: Generated file
  • hive/lib/src/isolate/isolated_compaction_strategy.g.dart: Generated file
  • hive/lib/src/schema/hive_schema.g.dart: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hive/lib/src/isolate/handler/isolated_hive_handler.dart
Comment thread hive/lib/src/isolate/isolated_compaction_strategy.dart Outdated
Comment thread hive/lib/src/isolate/isolated_compaction_strategy.dart
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.47%. Comparing base (e98c319) to head (64f302a).

Files with missing lines Patch % Lines
.../lib/src/isolate/isolated_compaction_strategy.dart 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
+ Coverage   93.40%   93.47%   +0.06%     
==========================================
  Files          64       66       +2     
  Lines        2625     2666      +41     
==========================================
+ Hits         2452     2492      +40     
- Misses        173      174       +1     

☔ View full report in Codecov by Harness.
📢 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.

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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.

CompactionStrategy unusable with IsolatedHive

2 participants