fix(limits): Enforce size limits consistently for all enevelope items#6250
Open
Dav1dde wants to merge 4 commits into
Open
fix(limits): Enforce size limits consistently for all enevelope items#6250Dav1dde wants to merge 4 commits into
Dav1dde wants to merge 4 commits into
Conversation
Dav1dde
force-pushed
the
dav1d/size-limits
branch
from
July 22, 2026 07:29
a0056d0 to
1401bbc
Compare
Dav1dde
marked this pull request as ready for review
July 22, 2026 07:31
Dav1dde
force-pushed
the
dav1d/size-limits
branch
from
July 22, 2026 07:33
1401bbc to
046d868
Compare
Dav1dde
marked this pull request as draft
July 22, 2026 07:33
Dav1dde
force-pushed
the
dav1d/size-limits
branch
from
July 22, 2026 07:55
046d868 to
0513a8e
Compare
Dav1dde
marked this pull request as ready for review
July 22, 2026 08:11
elramen
reviewed
Jul 22, 2026
| item_size: config.max_profile_size(), | ||
| total_count: 1, | ||
| total_size: config.max_profile_size(), | ||
| }; |
Comment on lines
+136
to
+139
| None => { | ||
| // Shouldn't be possible, if it still happens due to a bug, be defensive. | ||
| debug_assert!(false); | ||
| &mut empty |
Member
There was a problem hiding this comment.
Would it make sense to create a sentry error here?
Member
Author
There was a problem hiding this comment.
I considered it but it's a lot of noise for something that is already enforced at compile time through the match. I think I'd rather look into getting rid of the None case so we can fully rely on the compiler.
| "reason": "profiling_too_many_profiles", | ||
| "timestamp": time_within_delta(), | ||
| "quantity": 2, | ||
| "reason": "too_large:profile", |
Member
There was a problem hiding this comment.
Something to consider: add a separate too_many reason to differentiate between count vs size exceeds.
Member
Author
There was a problem hiding this comment.
Agreed, I also ideally want to improve the error message returned to the SDK. Will keep that as a follow-up.
loewenheim
approved these changes
Jul 23, 2026
elramen
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: INGEST-1057
Enforces size, total size and count limits for all envelope items, instead of only selectively. By adding these limits we effectively make accepted envelopes much stricter, it also adds a new metric to verify the limits are appropriate.
Also adds a few more limits that were missing. All limits configured to
1are forced by the protocol to be max1. Items which share the same limit of1are mutually exclusive in an envelope.There is a future improvement we can do in #6249 to improve how the limits are configured.