Honor explicit cookie cleanup after automatic collection - #100
Open
OskarEichler wants to merge 2 commits into
Open
Honor explicit cookie cleanup after automatic collection#100OskarEichler wants to merge 2 commits into
OskarEichler wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Run explicitly requested cleanup even after the automatic collection counter resets, and pass MozillaStore cleanup through to its in-memory session store. Automatic cleanup frequency on add remains unchanged.
Reproduction and verification
With gc_threshold: 1, adding a session cookie runs automatic cleanup and resets the counter; subsequent cleanup(true) does not remove it. MozillaStore additionally never forwards cleanup to its session jar. Both stores now pass this reproduction plus 12 assertions covering thresholds 1/100, persistent-cookie retention, ordinary cleanup and repeated session cleanup.
Verified this patch independently on master with Ruby 4.0.6 and SQLite3 2.9.6: existing rake test suite 144 tests, 2,870 assertions, zero failures/errors. Targeted syntax and git diff --check pass. Comparative RuboCop Lint adds no offenses (baseline 40; cleanup patch removes one). This repository does not configure a Ruby lint suite, so the comparison is supplementary, not a claim of clean full lint.
Focused checks are external scratch scripts. No repository tests were added or modified because this contribution's task explicitly prohibits test-file changes. All data is synthetic; SQLite checks use temporary/in-memory local databases. Other Ruby versions and upstream CI are not locally verified. Runtime source at installed v1.1.6 is identical apart from its version constant; consumer backports will retain that release instead of adopting the unreleased version/Ruby requirement.
Compatibility / breaking changes
No API changes. Explicit cleanup now performs its requested work even without new insertions. MozillaStore cleanup(true) removes in-memory session cookies. Explicit cleanup can therefore perform a scan where it previously incorrectly returned early; automatic add-triggered cadence is unchanged.