Skip to content

fix(orders): remove driver offers; only adhoc orders are offered - #398

Merged
roncodes merged 1 commit into
release/v0.6.72from
fix/remove-driver-offers
Oct 13, 2026
Merged

roncodes merged 1 commit into
release/v0.6.72from
fix/remove-driver-offers

Conversation

@roncodes

Copy link
Copy Markdown
Member

What

Removes the driver offers added in #394. An order assigned to a driver is simply theirs; only adhoc orders are offered to drivers, and Fleet-Ops' existing adhoc flow already handles that.

Why

#394 made every driver assignment an expiring offer in meta.offer (5 minutes by default). When the driver did not tap Accept, the order was marked expired and dispatch got "driver has not accepted", even though the driver was assigned and the order was theirs. That is not how dispatch works:

  • Assigned (by dispatch or auto-assign): the driver is notified and the order is theirs. Nothing to accept.
  • Adhoc: dispatching pings drivers within adhoc_distance (OrderPing), fleetops:dispatch-adhoc pings again every minute while nobody has taken it, and a driver takes it with start + assign. This existed before feat(orders): status-guarded edits, order.changed events, driver offers #394 and is unchanged.

meta.offer duplicated the adhoc flow and applied it to assigned orders.

Changes

Reverts ea06435 ("driver offers with accept, decline and expiry"):

  • meta.offer and its sync on assignment (order observer saving, bulk assign in the internal driver and order controllers)
  • POST v1/orders/{id}/accept and POST v1/orders/{id}/decline
  • fleetops:expire-offers (scheduled every minute), the driver_not_accepted alert (DriverNotAccepted), OrderOfferDeclined, the order.offer_expired|accepted|declined broadcasts (OrderOfferChanged)
  • offer on the v1 order resources; the fleetops.offer_timeout_minutes setting

Kept from #394: status-guarded edits and order.changed, telling a driver when an order is taken off them, and cancel with a reason. The cancel endpoint keeps the reasonFromRequest helper it shared with decline.

API and docs impact

Validation

Ran each test file on its own, as the repo's file runner does, with PHP 8.3, on this branch and on release/v0.6.72:

  • 507 files, 3266 tests. The files with errors or failures (21: realtime ingestion, tracking, socket channels and driver auth) fail the same way on release/v0.6.72 without this change. They look like local environment and vendor drift.
  • ApiOrderControllerContractsTest: 18 tests (19 before; the offers test is removed), 0 errors. OrderControllerLifecycleActionsTest, OrderOperationsTest, OrderChangeNotificationsTest, OrderAssignmentObserverTest: pass.
  • php-cs-fixer clean on the changed files.

Existing orders may still have a meta.offer from #394. Nothing reads it any more.

…rivers

Assigning a driver started an expiring "offer" in meta.offer that the driver
had to accept, and raised "driver not accepted" when they did not. That is
not how dispatch works: an order assigned to a driver (by dispatch or
auto-assign) is simply theirs. Only adhoc orders are offered, and the
existing adhoc flow already does it: dispatching pings drivers within
adhoc_distance (OrderPing), fleetops:dispatch-adhoc pings again every minute
while nobody has taken it, and a driver takes it with `start` + `assign`.

This reverts "feat(orders): driver offers with accept, decline and expiry":

- meta.offer and its sync on assignment (observer, bulk assign)
- POST v1/orders/{id}/accept and /decline
- fleetops:expire-offers, the driver_not_accepted alert (DriverNotAccepted),
  OrderOfferDeclined, the order.offer_* broadcasts
- `offer` on the order resources and fleetops.offer_timeout_minutes

The cancel reason keeps its request helper, which it shared with decline.
roncodes added a commit to fleetbase/postman that referenced this pull request Oct 13, 2026
Fleet-Ops drops driver offers in fleetbase/fleetops#398. Remove the Accept
an Order and Decline an Order requests and their examples, the offer field
on the Order object, the order.offer_* realtime events and the
offer_timeout_minutes setting. The Orders folder now explains that an
assigned driver simply has the order and only ad hoc orders are offered to
nearby drivers, taken with Start an Order and assign. The expected_status
override added for the offer requests is reverted, as nothing else in the
Fleetbase API collection uses it.
@roncodes
roncodes merged commit f5e4e5e into release/v0.6.72 Oct 13, 2026
4 of 6 checks passed
@roncodes
roncodes deleted the fix/remove-driver-offers branch October 13, 2026 18:12
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