Skip to content

Conversation

@ablaszkiewicz
Copy link
Contributor

Some collections may have big number of items to scan.

This PR limits it to 100.

Note: it doesn't limit to 100 scans per original variable but rather 100 scans per depth level. But it sounds reasonable. It's so we don't run out of limit on stupid scans with huge nested collections.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

posthog-python Compliance Report

Date: 2026-02-11 12:16:57 UTC
Duration: 159299ms

✅ All Tests Passed!

29/29 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 514ms
Format Validation.Event Has Uuid 1506ms
Format Validation.Event Has Lib Properties 1505ms
Format Validation.Distinct Id Is String 1506ms
Format Validation.Token Is Present 1505ms
Format Validation.Custom Properties Preserved 1504ms
Format Validation.Event Has Timestamp 1505ms
Retry Behavior.Retries On 503 9516ms
Retry Behavior.Does Not Retry On 400 3503ms
Retry Behavior.Does Not Retry On 401 3504ms
Retry Behavior.Respects Retry After Header 9512ms
Retry Behavior.Implements Backoff 23525ms
Retry Behavior.Retries On 500 7500ms
Retry Behavior.Retries On 502 7509ms
Retry Behavior.Retries On 504 7508ms
Retry Behavior.Max Retries Respected 23525ms
Deduplication.Generates Unique Uuids 1493ms
Deduplication.Preserves Uuid On Retry 7512ms
Deduplication.Preserves Uuid And Timestamp On Retry 14516ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 7505ms
Deduplication.No Duplicate Events In Batch 1501ms
Deduplication.Different Events Have Different Uuids 1505ms
Compression.Sends Gzip When Enabled 1505ms
Batch Format.Uses Proper Batch Structure 1505ms
Batch Format.Flush With No Events Sends Nothing 1004ms
Batch Format.Multiple Events Batched Together 1503ms
Error Handling.Does Not Retry On 403 3507ms
Error Handling.Does Not Retry On 413 3506ms
Error Handling.Retries On 408 7511ms

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.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

result = {}
for k, v in value.items():
for i, (k, v) in enumerate(value.items()):
if i >= _MAX_COLLECTION_ITEMS_TO_SCAN:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think truncating object is confusing, It would be better to just return a redacted value imo, like CODE_VARIABLES_TOO_LONG_VALUE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about it and I thought that it's better to return something than not return anything, no?

We can add an info thing on frontend that some of data was truncated because object was too long or something

Copy link
Contributor

Choose a reason for hiding this comment

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

If we display something on the frontend that the object has been truncated yes, but as a first step showing redacted values might be easier. I think we want to prevent users having to understand why their object or list does not contain all the items.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Applied that change

@ablaszkiewicz ablaszkiewicz merged commit 499194e into master Feb 11, 2026
22 checks passed
@ablaszkiewicz ablaszkiewicz deleted the ab/fix/code-variables-limit-collections-scan branch February 11, 2026 13:59
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