Skip to content

Remove Dead Code - #170

Merged
mstdokumaci merged 4 commits into
mainfrom
eliminate-dead-code
Jul 31, 2026
Merged

mstdokumaci merged 4 commits into
mainfrom
eliminate-dead-code

Conversation

@mstdokumaci

@mstdokumaci mstdokumaci commented Jul 31, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Refactor

    • Streamlined the public API by removing obsolete cache, queue, response, mapping, configuration, and wire-format helpers.
    • Improved validation and reference detection across production and test code.
    • Existing parsing, encoding, queue shutdown, and cache behavior remain unchanged.
  • Compatibility

    • Applications relying on removed public helpers, aliases, or configuration types will need to migrate to supported alternatives.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7834d20e-2329-4659-9e50-b8242d1e4d6e

📥 Commits

Reviewing files that changed from the base of the PR and between 2f91db5 and f8b4eca.

📒 Files selected for processing (3)
  • scripts/unused_pub_detector.js
  • src/config_loader.zig
  • src/memory_strategy.zig
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/unused_pub_detector.js

📝 Walkthrough

Walkthrough

The change improves nested public-reference detection and removes unused public APIs, exports, configuration types, and wire keys. A queue test now verifies emptiness through non-blocking pop behavior.

Changes

Reference detection

Layer / File(s) Summary
Improve nested reference detection
scripts/unused_pub_detector.js
Declaration exclusions use scope-stack state. Member matching escapes names and supports separate parent and member access with production or test classification.

API and reference cleanup

Layer / File(s) Summary
Remove lock-free cache operations
src/lock_free_cache.zig
The cache no longer exposes bulkEvict or size.
Restrict unused public declarations
src/connection/state.zig, src/msgpack_utils.zig, src/storage_engine.zig, src/config_loader.zig, src/memory_strategy.zig
Unused public declarations are removed or made private.
Update queue validation and wire keys
src/subscription/change_queue_test.zig, src/wire/encode.zig
The shard test uses popTimed(0), and the details and token wire keys are removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: removing unused code and public API declarations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/unused_pub_detector.js`:
- Around line 221-227: Update the fallback branch around hasWord(fText, qn) so
nested-member matches require Parent and member to occur as the same
structurally related reference, rather than independently anywhere in the file;
preserve valid supported constructs and reject unrelated forms such as
Other.member. Add regression coverage for both valid and unrelated cross-file
matches.

In `@src/subscription/change_queue_test.zig`:
- Around line 128-131: Update the shard emptiness check in the test to retain
any value returned by shard.popTimed(0), deinitialize an unexpected
OwnedRecordChange with alloc before failing, and register queue.deinit() with
defer immediately after queue creation so cleanup runs even when the assertion
returns an error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 48b59da9-609e-4b54-9238-e6278ea2acb8

📥 Commits

Reviewing files that changed from the base of the PR and between 0fc41e8 and 169d06e.

📒 Files selected for processing (8)
  • scripts/unused_pub_detector.js
  • src/connection/state.zig
  • src/lock_free_cache.zig
  • src/msgpack_utils.zig
  • src/queues/spmc_blocking_queue.zig
  • src/storage_engine.zig
  • src/subscription/change_queue_test.zig
  • src/wire/encode.zig
💤 Files with no reviewable changes (6)
  • src/queues/spmc_blocking_queue.zig
  • src/connection/state.zig
  • src/wire/encode.zig
  • src/lock_free_cache.zig
  • src/msgpack_utils.zig
  • src/storage_engine.zig

Comment thread scripts/unused_pub_detector.js Outdated
Comment thread src/subscription/change_queue_test.zig Outdated
@mstdokumaci
mstdokumaci merged commit ed6d010 into main Jul 31, 2026
14 of 15 checks passed
@mstdokumaci
mstdokumaci deleted the eliminate-dead-code branch July 31, 2026 18:35
This was referenced Jul 31, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Aug 16, 2026
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.

1 participant