Skip to content

Conversation

@Christinarlong
Copy link
Contributor

@Christinarlong Christinarlong commented Jan 12, 2026

Okay basically we're caching the bulk query and adapting the single detector query in the subscription processor work with that.

Cursor Bugbot reviewed your changes and found no issues for commit e31fc92

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 12, 2026
Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

let me know if it'd help to hop on a call / discuss any of these comments too! this whole area is pretty confusing, even for those with context. haha

Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

up to you on flattening the cache stuff and pulling it off of the detector model, i would recommend it as it will allow us to DRY up the code around purging / updating the cache.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

🎉 this is looking great, mostly detailed comments on the implementation.

Detector.objects.filter(
enabled=True, data_sources__source_id=source_id, data_sources__type=query_type
cache_access = DetectorByDataSourceCacheAccess(source_id, query_type)
detectors = cache_access.get()
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also add a rollout flag here so we can easily enable / disable caching incase there are any unexpected issues or invalidations we haven't accounted for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one is a little weird since I'm not sure if the tradeoff is worth it. This callsite has some indirection where in order to reference an organization we need to look up the DataSource -> Organization. That's a db query every time though so although it's here idk if it's worth it.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants