Skip to content

test: fix e2e cache-invalidation helper to call invalidate_user - #64

Merged
JarbasAl merged 1 commit into
devfrom
fix/e2e-reset-user-invalidate-user
Sep 2, 2026
Merged

test: fix e2e cache-invalidation helper to call invalidate_user#64
JarbasAl merged 1 commit into
devfrom
fix/e2e-reset-user-invalidate-user

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Sep 2, 2026

Copy link
Copy Markdown
Member

🤖 Auto-generated by Claude Sonnet 5 (claude-sonnet-5) via Claude Code — NOT human-reviewed. Verify before acting.

The e2e cache-invalidation helper _reset_resolution_cache in tests/e2e/test_policy_migration_e2e.py checked hasattr(conn, "reset_user") before flushing the resolve_user cache on live connections. That method does not exist anywhere in the codebase; the real method is invalidate_user(), defined on the HiveMind connection in hivemind_core/protocol.py. Because the guard always evaluated to False, the 5-second resolve_user cache was never flushed, so test_migrated_skill_blacklist_reaches_session served a stale pre-migration user and never actually exercised the migration path it claims to validate.

This changes the guard to check for and call invalidate_user() instead. Only the test file is touched; no product code changed.

I verified this end-to-end rather than trusting the diff. With the fix reverted (patch-revert, not stash) the test fails with blacklisted_skills missing ['skill-weather']. With the fix restored it passes, confirming the migrated blacklist now reaches the OVOS session as intended. The full test suite (68 tests, 3 skipped) passes with the fix in place.

_reset_resolution_cache guarded on hasattr(conn, "reset_user"), a method
that does not exist on HiveMind connections; the real method is
invalidate_user() (hivemind_core.protocol). The hasattr guard was always
False, so the resolve_user cache (5s TTL) was never flushed and
test_migrated_skill_blacklist_reaches_session silently served a stale
pre-migration user, never exercising the migration path it claims to
validate.

Verified the corrected helper end-to-end: reverting only this source
change against the fix makes test_migrated_skill_blacklist_reaches_session
fail with "blacklisted_skills missing ['skill-weather']"; restoring it
makes the test pass. Full test suite: 68 passed, 3 skipped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Beep! Your PR results are served. 🍽️

I've aggregated the results of the automated checks for this PR below.

📋 Repo Health

I've performed a digital acupuncture on the codebase. 📍

✅ All required files present.

Latest Version: 0.4.3a5

hivemind_sqlite_database/version.py — Version file
README.md — README
LICENSE.md — License file (consider renaming to LICENSE)
pyproject.toml — pyproject.toml
⚠️ setup.py — setup.py
CHANGELOG.md — Changelog
hivemind_sqlite_database/version.py has valid version block markers

🏷️ Release Preview

I've checked the 'Bug Fixes' list for accuracy. 🐛

Current: 0.4.3a5Next: 0.4.3a6

Signal Value
Label (none)
PR title test: fix e2e cache-invalidation helper to call invalidate_user
Bump alpha

✅ PR title follows conventional commit format.


🚀 Release Channel Compatibility

Predicted next version: 0.4.3a6

Channel Status Note Current Constraint
Stable Not in channel -
Testing Not in channel -
Alpha Compatible hivemind-sqlite-database>=0.4.3a5

📊 Coverage

Evaluating the thoroughness of our test suite. 🔎

85.6% total coverage

Per-file coverage (2 files)
File Coverage Missing lines
hivemind_sqlite_database/version.py 0.0% 5
hivemind_sqlite_database/__init__.py 87.8% 24

Full report: download the coverage-report artifact.

🔍 Lint

Processing complete! Details follow. 📬

ruff: issues found — see job log

🔨 Build Tests

The build bots are giving this a thumbs up. 👍

✅ All versions pass

Python Build Install Tests
3.10
3.11
3.12
3.13
3.14

🔒 Security (pip-audit)

Ensuring our data is safe and secure. 🔐

✅ No known vulnerabilities found (70 packages scanned).


Every line of code matters. Thanks for contributing! 💖

@JarbasAl
JarbasAl marked this pull request as ready for review September 2, 2026 22:24
@JarbasAl
JarbasAl merged commit 0065649 into dev Sep 2, 2026
15 checks passed
@JarbasAl
JarbasAl deleted the fix/e2e-reset-user-invalidate-user branch September 2, 2026 22:24
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