Skip to content

fix: Clear feature flag called cache on shutdown#194

Merged
marandaneto merged 2 commits into
mainfrom
fix/ff-called-cache-shutdown
Jun 24, 2026
Merged

fix: Clear feature flag called cache on shutdown#194
marandaneto merged 2 commits into
mainfrom
fix/ff-called-cache-shutdown

Conversation

@marandaneto

Copy link
Copy Markdown
Member

💡 Motivation and Context

Feature flag call deduplication state currently remains in memory after shutdown, which can leak stale called-cache state across a client shutdown/reuse lifecycle. This clears the cache during shutdown while holding the existing cache mutex.

💚 How did you test it?

  • bundle exec rspec spec/posthog/client_spec.rb
  • git diff --check

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed. (Not needed.)
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Added a changeset file (.changeset/quiet-cycles-shutdown.md)

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

An agent prepared this PR from the dedicated fix/ff-called-cache-shutdown worktree at the user's direction. The change adds a guarded shutdown-time clear of the feature flag call dedupe cache, a regression spec for that behavior, and a patch changeset for posthog-ruby.

Validation included the client spec file and whitespace checks. A local pnpm changeset status --since=main validation attempt failed because dependencies are not installed in this worktree (changeset executable missing), but the changeset file was added using the repository's Changesets format.

@marandaneto marandaneto self-assigned this Jun 24, 2026
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix: Clear feature flag called cache on ..." | Re-trigger Greptile

Comment thread .changeset/quiet-cycles-shutdown.md
@marandaneto marandaneto marked this pull request as ready for review June 24, 2026 17:43
@marandaneto marandaneto requested a review from a team as a code owner June 24, 2026 17:43
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "chore: release posthog-rails for shutdow..." | Re-trigger Greptile

@marandaneto marandaneto merged commit 45996be into main Jun 24, 2026
19 checks passed
@marandaneto marandaneto deleted the fix/ff-called-cache-shutdown branch June 24, 2026 18:46
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.

2 participants