Repository navigation
fix(events): gzip analytics event payloads when compression is enabled - #442
Merged
abelonogov-ld merged 1 commit intoNov 21, 2026
Conversation
Persisted batches are posted by AnalyticsEventSender, which ignored EventProcessorBuilder.enableCompression, so only diagnostic events were compressed. The batch on disk stays plain JSON; each attempt compresses it, and one that cannot be compressed goes uncompressed. Co-authored-by: Cursor <cursoragent@cursor.com>
2 of 3 tasks
abelonogov-ld
merged commit Nov 21, 2026
71ed617
into
andrey/event-durability-tier3-persistence
8 checks passed
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.


Stacked on #408 (tier 3).
mainaddedEventProcessorBuilder.enableCompression(#414). Since tier 3, analytics events are posted byAnalyticsEventSender, which ignored that option, so only diagnostic events were compressed andEventCompressionTest.eventPayloadsAreGzipEncodedWhenCompressionIsEnabledfailed.AnalyticsEventSendertakes acompressflag, wired fromenableCompressioninComponentsImpl.Content-Encoding: gzip. The batch on disk stays plain JSON, so every attempt at a delivery, including one by a later run, compresses the same bytes under the same payload ID.EventCompressionTestpasses on this branch.Note
Overview
Analytics event delivery now honors
EventProcessorBuilder.enableCompression, which previously only affected diagnostic posts viaDefaultEventSender.AnalyticsEventSenderaccepts acompressflag (wired fromenableCompressioninComponentsImpl). When enabled, eachsendBatchgzip-encodes the JSON body and setsContent-Encoding: gzip; persisted batches on disk remain plain JSON so retries and later app runs re-compress the same bytes under the same payload ID. If gzip fails, the batch is sent uncompressed with a warning instead of being dropped.Tests construct
AnalyticsEventSenderwith an explicit compress argument soEventCompressionTestcan assert analytics payloads are gzip-encoded when compression is on.Reviewed by Cursor Bugbot for commit 71ed617. Bugbot is set up for automated code reviews on this repo. Configure here.