Skip to content

Revert "feat(server) added eviction strategy"#1286

Merged
Mzack9999 merged 1 commit intomainfrom
revert-1275-feature/eviction-strategy
Nov 24, 2025
Merged

Revert "feat(server) added eviction strategy"#1286
Mzack9999 merged 1 commit intomainfrom
revert-1275-feature/eviction-strategy

Conversation

@Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Nov 24, 2025

Reverts #1275

Summary by CodeRabbit

  • Removed Features

    • Removed the eviction strategy CLI flag (-es/--eviction-strategy) that previously allowed users to select between sliding and fixed eviction strategies.
  • Behavioral Changes

    • Storage eviction now consistently uses a single expire-after-access approach instead of supporting multiple strategy options.
  • Tests

    • Removed eviction strategy-specific test cases.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request removes the eviction-strategy CLI flag and all associated code infrastructure. The EvictionStrategy type definition, constants, struct fields, CLI parsing logic, and conditional eviction behavior are deleted across multiple files. Eviction now defaults to expire-after-access when EvictionTTL is set, without runtime strategy selection.

Changes

Cohort / File(s) Summary
Documentation
README.md
Removed eviction-strategy flag (-es / --eviction-strategy) from CLI input options documentation, eliminating references to sliding/fixed strategy choices and defaults.
CLI & Options Configuration
cmd/interactsh-server/main.go, pkg/options/server_options.go, pkg/storage/option.go
Removed EvictionStrategy field from CLIServerOptions struct; deleted EvictionStrategy type definition, constants (EvictionStrategySliding, EvictionStrategyFixed), and associated CLI flag parsing/validation logic; updated DefaultOptions to omit EvictionStrategy initialization.
Storage Implementation
pkg/storage/storagedb.go
Simplified eviction logic to unconditionally apply expire-after-access when EvictionTTL > 0, removing the previous conditional branch that selected expire-after-write for fixed strategy.
Tests
pkg/storage/storagedb_test.go
Removed TestSlidingEvictionStrategy and TestFixedEvictionStrategy test functions including their timing-based assertions and setup/cleanup logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify all references to EvictionStrategy throughout the codebase are eliminated
  • Confirm the simplified expire-after-access logic in storagedb.go is the intended default behavior
  • Ensure test suite adequately covers the remaining eviction functionality

Poem

🐰 The strategy flag hops away,
No more fixed-or-sliding play,
One true path remains so clear—
Expire-after-access for all we hold dear! 🌿✨

✨ 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 revert-1275-feature/eviction-strategy

📜 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 f9a1dd1 and e1332ce.

📒 Files selected for processing (6)
  • README.md (0 hunks)
  • cmd/interactsh-server/main.go (0 hunks)
  • pkg/options/server_options.go (0 hunks)
  • pkg/storage/option.go (1 hunks)
  • pkg/storage/storagedb.go (1 hunks)
  • pkg/storage/storagedb_test.go (0 hunks)

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.

@Mzack9999 Mzack9999 merged commit 0eb8a06 into main Nov 24, 2025
1 check was pending
@Mzack9999 Mzack9999 deleted the revert-1275-feature/eviction-strategy branch November 24, 2025 11:13
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