Skip to content

Support sending and retrieving caching headers in requests/responses#15

Merged
johnjohndoe merged 3 commits into
masterfrom
engelsystem-base-headers
May 10, 2025
Merged

Support sending and retrieving caching headers in requests/responses#15
johnjohndoe merged 3 commits into
masterfrom
engelsystem-base-headers

Conversation

@johnjohndoe

@johnjohndoe johnjohndoe commented May 10, 2025

Copy link
Copy Markdown
Owner

Context

  • This breaking change allows to set the HTTP headers If-None-Match and If-Modified-Since at a request and get the HTTP headers ETag and Last-Modified from a response. This allows to reduce the transferred data to a minimum due to the support of HTTP 304 Not Modified.

Description

  • Let EngelsystemService#getShifts return Response<List<Shift>>.
    • Add eTag and lastModifiedAt parameters.
    • Expose retrofit2.Response in library API.
  • Refine Api in general.
    • Rename ApiModule to Api.
    • Change Api#provideEngelsystemService parameter from okHttpClient: OkHttpClient to callFactory: Call.Factory.
    • Require baseUrl parameter in Api#provideEngelsystemService not to be empty string.

Related

Breaking changes:
+ Rename "ApiModule" to "Api".
+ Change "Api#provideEngelsystemService" parameter from
  "okHttpClient: OkHttpClient" to "callFactory: Call.Factory".
+ Require "baseUrl" parameter in "Api#provideEngelsystemService" not to be
  empty string.
+ Apps need to adapt!
+ Add `eTag` and `lastModifiedAt` parameters.
+ Expose `retrofit2.Response` in library API.
+ This is a breaking change. Apps need to adapt!
@github-actions

Copy link
Copy Markdown

Test Results

14 tests  ±0   14 ✅ ±0   2s ⏱️ ±0s
 5 suites ±0    0 💤 ±0 
 5 files   ±0    0 ❌ ±0 

Results for commit 47e5297. ± Comparison against base commit 99af090.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
info.metadude.kotlin.library.engelsystem.ProductionApiTest ‑ Validates a failure shifts response()
info.metadude.kotlin.library.engelsystem.ProductionApiTest ‑ Validates a successful shifts response()
info.metadude.kotlin.library.engelsystem.ProductionApiTest ‑ getShifts responds successfully()
info.metadude.kotlin.library.engelsystem.ProductionApiTest ‑ getShifts throws HTTP exception()

@johnjohndoe johnjohndoe merged commit 80a3ca4 into master May 10, 2025
5 checks passed
@johnjohndoe johnjohndoe deleted the engelsystem-base-headers branch May 10, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant