Skip to content

🐛 filter walk-in / non-web-bookable campsites by default (UseDirect)#413

Open
luckyrandom wants to merge 1 commit into
juftin:mainfrom
luckyrandom:fix/walkin-filter
Open

🐛 filter walk-in / non-web-bookable campsites by default (UseDirect)#413
luckyrandom wants to merge 1 commit into
juftin:mainfrom
luckyrandom:fix/walkin-filter

Conversation

@luckyrandom

Copy link
Copy Markdown

The bug

The UseDirect API (ReserveCalifornia and siblings) marks walk-in /
non-web-bookable nights as availability_status="Available", the same
status reservable sites get. Camply forwards every "Available" night to
the user, so cancellation watchers fire false-positive notifications on
sites that physically cannot be reserved online — the user races to
ReserveCalifornia.com, picks the date, and the site isn't even listed.

Concrete reproducer at Sugarloaf Ridge SP (campground id 731) for
2026-06-06:

camply campsites --provider ReserveCalifornia --campground 731 \
  --start-date 2026-06-06 --end-date 2026-06-07 --nights 1

Reports 3 "available" sites: #4, #5, #35. None of the three can
actually be booked via the website. Raw API dump for those same units:

site  AllowWebBooking  IsWalkin
#04   True             True
#05   False            True
#35   False            True

The data is already there in UseDirectAvailabilityUnit.AllowWebBooking
(per-site) and UseDirectAvailabilitySlice.IsWalkin (per-night). Camply
just wasn't reading them when deciding whether to surface a site.

Note that AllowWebBooking=True does not imply bookable — site #4 is
normally bookable but held back for walk-ups on this specific date,
which is what IsWalkin captures. Both flags must be checked.

The fix

Treat a slice as bookable only when:

availability_slice.IsWalkin is not True
and unit.AllowWebBooking is not False

The check is in the same loop in UseDirectProvider.get_campsites
that already filters by availability_status == "Available" — minimal
surface area, no new API calls.

Escape hatch

Add --include-walkin (off by default) so anyone who wants the old
behavior — or who's specifically hunting walk-ins — can opt back in:

camply campsites ... --include-walkin

Plumbing follows the existing --equipment pattern: click option in
cli.py, threaded through _get_provider_kwargs_from_cli into
provider_kwargs, accepted by SearchUseDirect.__init__, forwarded to
UseDirectProvider.get_campsites.

Verification

Same query as the reproducer above:

(default)              0 Reservable Campsites Matching   ✓
--include-walkin       3 Reservable Campsites Matching   ✓

Other providers (Recreation.gov, GoingToCamp, Yellowstone, …) are
unaffected — the param is UseDirect-specific and only the UseDirect
search class reads it.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

## The bug

The UseDirect API (ReserveCalifornia and siblings) marks walk-in /
non-web-bookable nights as `availability_status="Available"`, the same
status reservable sites get. Camply forwards every "Available" night to
the user, so cancellation watchers fire false-positive notifications on
sites that physically cannot be reserved online — the user races to
ReserveCalifornia.com, picks the date, and the site isn't even listed.

Concrete reproducer at Sugarloaf Ridge SP (campground id 731) for
2026-06-06:

    camply campsites --provider ReserveCalifornia --campground 731 \
      --start-date 2026-06-06 --end-date 2026-06-07 --nights 1

Reports 3 "available" sites: juftin#4, juftin#5, juftin#35. None of the three can
actually be booked via the website. Raw API dump for those same units:

    site  AllowWebBooking  IsWalkin
    juftin#4   True             True
    juftin#5   False            True
    juftin#35   False            True

The data is already there in `UseDirectAvailabilityUnit.AllowWebBooking`
(per-site) and `UseDirectAvailabilitySlice.IsWalkin` (per-night). Camply
just wasn't reading them when deciding whether to surface a site.

Note that `AllowWebBooking=True` does not imply bookable — site juftin#4 is
normally bookable but held back for walk-ups on this specific date,
which is what `IsWalkin` captures. Both flags must be checked.

## The fix

Treat a slice as bookable only when:

    availability_slice.IsWalkin is not True
    and unit.AllowWebBooking is not False

The check is in the same loop in `UseDirectProvider.get_campsites`
that already filters by `availability_status == "Available"` — minimal
surface area, no new API calls.

## Escape hatch

Add `--include-walkin` (off by default) so anyone who wants the old
behavior — or who's specifically hunting walk-ins — can opt back in:

    camply campsites ... --include-walkin

Plumbing follows the existing `--equipment` pattern: click option in
`cli.py`, threaded through `_get_provider_kwargs_from_cli` into
`provider_kwargs`, accepted by `SearchUseDirect.__init__`, forwarded to
`UseDirectProvider.get_campsites`.

## Verification

Same query as the reproducer above:

    (default)              0 Reservable Campsites Matching   ✓
    --include-walkin       3 Reservable Campsites Matching   ✓

Other providers (Recreation.gov, GoingToCamp, Yellowstone, …) are
unaffected — the param is UseDirect-specific and only the UseDirect
search class reads it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@luckyrandom

Copy link
Copy Markdown
Author

Please let me know if it should be off by default for better backward compatibility.

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