Skip to content

Release 1.10.0 (versionCode 24) - #54

Merged
fabiodalez-dev merged 7 commits into
mainfrom
release/1.10.0
Oct 21, 2026
Merged

fabiodalez-dev merged 7 commits into
mainfrom
release/1.10.0

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

What this release contains

  • Stop the loan request before a scheduled loan and say how long it can be #53: a loan request stops before a scheduled loan and says how long it can be. The sheet caps the return the day before the first fully-booked day, also within the library's max_loan_duration_days, and sends it as end_date; a start whose next day is booked says no loan is possible. Pairs with Pinakes 0.8.7 (#490, Mobile API 1.8.2); older servers keep the 1.9.0 behaviour.

Release commit 495d0f7: versionCode 23 → 24, versionName 1.9.0 → 1.10.0, a 1.10.0 section in STATUS.md, and LoanRequestSheetUiTest updated to the sheet's onConfirm(start, end) (it no longer compiled after the merge), now also checking that no end date is sent when nothing caps the window.

Checks

  • 444 debug unit tests, none failed or skipped; lint and assembleDebug.
  • 17 device tests on an Android 15 emulator (LoanRequestSheetUiTest, CalendarLayoutTest, DesiderataStaffFlowTest, DigitalLinkRefreshFlowTest), none failed.
  • Server contract checked against Pinakes 0.8.7: max_loan_duration_days in the availability calendar, end_date on POST /reservations, meta.max_end_date / max_duration_days / first_conflict_date on a refusal. All are optional in the app.
  • No change to the Room cache (version 3).

Merging this PR also merges #53.

The loan-request sheet proposed the chosen start plus the library's
loan_duration_days whatever the calendar showed. When a scheduled loan
or a reservation on every copy began inside that window the server
refused the whole request with a bare "not available", although a
shorter loan was possible, and the reader was never told how long.

LoanWindow.kt reads the availability calendar the sheet already holds:
the first fully-booked day inside the duration bounds the loan, the
return date becomes the day before it, and the sheet explains it under
the calendar: maximum loan length, return date, and the day from which
the book is already booked. The request then carries that date as
end_date of POST /reservations (Mobile API 1.8.2), so the server
accepts the shortened loan the way the website calendar does. Tapping a
red day, which cannot be picked, now says why. A not_available refusal
from the server carries its own explanation and meta figures
(max_end_date, max_duration_days, first_conflict_date); the message is
what the reader sees and the figures are modelled for later use.

Strings in it, en, de, fr. LoanWindowTest covers the capped, uncapped,
conflict-beyond-duration, next-day-blocked, partial-day, unavailable-
dates and unknown-duration cases; the sheet tests take the two-argument
confirm callback. The API contract documents end_date.
…et and the envelope

A commitment on the very next day leaves no loan of at least one day:
LoanWindow.possible is false, the sheet says so ("no loan is possible
from this start date: the book is already booked from D") and disables
the request instead of proposing a same-day return. The availability
payload's max_loan_duration_days (Mobile API 1.8.2) is modelled.

LoanRequestWindowTest renders the sheet: a scheduled loan inside the
duration shortens the return date and the note says so; confirming sends
the shortened date as end_date; with no conflict nothing is explained
and no end_date is sent; tapping a fully-booked day explains why it
cannot be picked and leaves the pick unchanged; a commitment on the next
day disables the request. ReservationRefusalEnvelopeTest pins what the
server says to the app: the not_available sentence and meta figures, a
refusal without figures, the max_duration_exceeded code, end_date sent
only when shortened, both durations in the availability payload.
…r note

CalendarModel painted a day labelled free with no free copy red and
unpickable, but loanWindowFrom only looked at unavailable_dates and the
full state, so such a day inside the duration did not cap the request
and the server refused it. AvailabilityCalendar.isFullyBooked() is now
the one predicate both use, with a test for the stale label.

A cap one day out read "1 days": book_loan_limit_note_one is the
singular variant (the string generator has no plurals). The zero-day
case already reads as "no loan is possible from this start date".
Bumps the version and records in STATUS what 1.10.0 brings: loan requests bounded by a scheduled loan and by the configured maximum (#53, Pinakes #490). LoanRequestSheetUiTest follows the sheet's new onConfirm(start, end) and checks that no end date is sent when nothing caps the window.
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 830f2cef-9f4e-4a96-a04e-2c2f4943bd1d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

On a Pinakes 0.8.6 server the sheet shows a shortened loan that the server cannot grant. The release notes say older servers keep the 1.9.0 behaviour, but that is not true for 0.8.6 (see inline).

Reviewed changes

I reviewed the 1.10.0 release branch. It merges the still-open #53 (the loan window cap) and bumps the version.

  • Loan window: the new loanWindowFrom ends the request the day before the first fully-booked day, or at max_loan_duration_days. The sheet explains the cap, explains a tapped red day, disables the request when no window is left, and sends end_date.
  • Single red-day predicate: AvailabilityCalendar.isFullyBooked now drives both CalendarModel.kind and the window, so the days the calendar paints red are the days that cap the loan.
  • API plumbing: ReservationRequest.end_date is passed through LibraryRepository.reserve and BookDetailViewModel.reserve. Meta and AvailabilityCalendar gain the optional Mobile API 1.8.2 fields.
  • Release bookkeeping: versionCode goes to 24 and versionName to 1.10.0, STATUS.md gains a 1.10.0 section, and four i18n keys are added in all four languages. The count of 444 JVM @Tests matches the tree.

I checked the server side against the Pinakes tags. LoanWindow::cap in v0.8.7 picks the first conflict strictly after the start, which is the same rule the app uses.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread app/src/main/java/com/pinakes/app/ui/screens/detail/LoanWindow.kt
Pinakes 0.8.6 (Mobile API 1.8.1) already sends loan_duration_days but ignores end_date, so the sheet showed a shortened return date the server would refuse or end on another day. loanWindowFrom() caps only when the calendar carries max_loan_duration_days, which Pinakes 0.8.7 always sends; without it the window is the default one, uncapped and without end_date, as in 1.9.0. LoanWindowTest covers both cases (they fail without the check), and the fixtures of the capped cases now carry the maximum as a 0.8.7 server sends it.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found. The new commit fixes the 0.8.6 compatibility issue from the previous review.

Reviewed changes

I reviewed the one commit pushed since the previous review (aa5feb7).

  • The cap now depends on the server version: when the calendar has no max_loan_duration_days, as with Pinakes 0.8.6 / Mobile API 1.8.1, loanWindowFrom now returns the default window: start + loan_duration_days, uncapped, possible, and no end_date. That matches the 1.9.0 behaviour the release notes promise. The hint shows the same date the old loanReturnDate gave, the request button stays enabled, and no cap or no-window note appears. On 1.8.2 servers nothing changes.
  • Tests: the fixtures in LoanWindowTest that expect a cap now set maxLoanDurationDays = 90, like a 0.8.7 server. Two new cases check that an old server never caps the window and never says no loan is possible. The fixture in LoanRequestWindowTest already set the field, and the tests without it (LoanRequestReturnDateTest, LoanRequestSheetUiTest) still expect the uncapped result.
  • STATUS.md: the 1.10.0 notes now describe the gate, and the unit test count went from 444 to 446. I checked that 446 matches the @Test count in the tree.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@fabiodalez-dev
fabiodalez-dev merged commit cf98dd8 into main Oct 21, 2026
3 checks passed
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.

1 participant