okhttp4 Phase E: consolidate GzipRequestInterceptor into one shared class - #4593
Open
ahaarrestad wants to merge 8 commits into
Open
Conversation
…(Phase E) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ase E) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…S_GZIP_DECIDER (Phase E) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tor (Phase E) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the nsfollow and tidepool duplicate copies and their tests, now that all consumers use the shared class at utils/framework. Also fix four test files that still imported from the old nsfollow location, and remove the dead commented-out addInterceptor line in TidepoolUploader. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eptor (Phase E) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e-gzip-consolidation
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.
Summary
Consolidates three separate
GzipRequestInterceptorimplementations into one shared class, with no observable behavior change. Part of the okhttp4 migration (Phase E — independent of the B1/B2 version bump in #4589; this branch is offmasteron okhttp 3.12.13).What was actually there (the premise "3 identical copies" was wrong)
cgm/nsfollow/GzipRequestInterceptorpublic,// TODO make reusablebody == nullorContent-EncodingpresentSendFeedBack,NightLiteClient,RetrofitService,sharefollow/RetrofitBasetidepool/GzipRequestInterceptorNightscoutUploader.GzipRequestInterceptorstaticclass!supportsGzip(host+port)NightscoutUploaderSo: 2 identical copies + 1 with a per-server capability gate — not 3 identical copies.
Change
com.eveningoutpost.dexdrip.utils.framework.GzipRequestInterceptor+ a smallGzipDeciderfunctional interface.GzipRequestInterceptor(GzipDecider)→ per-request gate.NightscoutUploadernow passesNS_GZIP_DECIDER = req -> supportsGzip(host+port), preserving its per-server gzip gating verbatim (same id construction, samePersistentStoremarkerns-end-supports-gzip-, same short-circuit order).tidepool/GzipRequestInterceptorcopy and the dead commented-out usage line inTidepoolUploader.Note:
okhttp3.*/okio.*package names are correct and remain so under okhttp 4.x (4.x keeps theokhttp3package). The deprecatedRequestBody.create(MediaType, String)arg order is intentionally left for Phase C (deprecation cleanup); Phase E actually shrinks Phase C's gzip scope from 3 copies to 1.Testing
NightscoutUploader'ssupportsGzipgate through the shared class (marker true → gzip; absent → passthrough; GET/no-body and already-encoded passthrough).MockWebServerround-trips, gunzip assertions../gradlew test→ BUILD SUCCESSFUL, 0 failures.