Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: count playlists with filters #29113

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Feb 23, 2025

  • adds a task that finds playlists with filters for teams on an allowlist
  • adds a task that runs those filters and stores results in redis
  • returns the count of filters or pinned when listing playlists
Screenshot 2025-02-26 at 13 47 19 Screenshot 2025-02-23 at 14 24 54

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds functionality to count and cache the number of recordings matching playlist filters, with controlled rollout to specific teams.

  • Added new Celery task count_recordings_that_match_playlist_filters in /ee/session_recordings/playlist_counters/recordings_that_match_playlist_filters.py that runs every 15 seconds, which seems too frequent for this operation
  • Implemented Redis caching with 36-hour TTL in /ee/session_recordings/playlist_counters/recordings_that_match_playlist_filters.py but lacks cache invalidation strategy
  • Added team allowlist via TEAMS_WITH_PLAYLIST_COUNTER_PROCESSING in /posthog/settings/session_replay.py for controlled feature rollout
  • Missing error handling for Redis connection failures in /ee/session_recordings/session_recording_playlist.py
  • Potential race condition in /ee/session_recordings/playlist_counters/recordings_that_match_playlist_filters.py when multiple tasks update the same playlist count simultaneously

9 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Feb 23, 2025

Size Change: +133 B (0%)

Total Size: 9.72 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.72 MB +133 B (0%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

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