You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8919831
Browse filesBrowse the repository at this point in the historyBrowse files
A retry with the same buyer and hold ID after the deadline creates a
fresh hold. When the scheduler had already queued the old expiry, that
expiry removed the fresh hold, because expire checked only the hold ID.
The reminder now passes the stored deadline, and expire releases a seat
only when the hold ID and the deadline both match, as SeatInventory
does. A new test retries after the deadline and then delivers the old
expiry; with the deadline check removed, it fails.
- The `hold` and `confirm` methods first call the private `release_expired_holds` method. This method removes each hold at or past its deadline and returns its seat.
164
164
- The stored deadline is the rule. After the deadline, the actor rejects confirmation, even before the reminder runs. A stopped or slow runtime process does not extend a hold.
165
165
- The `confirm` method moves the hold to `sold` and cancels the reminder with `unschedule`.
166
-
- The `expire`method releases the seat only when the `hold_id`still matches. An expiry for an old hold does nothing. The reminder cleans up the hold if no other call releases it first.
166
+
- The reminder passes the stored deadline: `expire(buyer:, hold_id:, expires_at:)`. The `expire`method releases the seat only when both the hold ID and the deadline still match the stored hold. An expiry for an old hold does nothing. An expiry that the scheduler queued before a retry created a fresh hold with the same hold ID also does nothing. The reminder cleans up the hold if no other call releases it first.
167
167
- A retry of `hold` with the same IDs returns the same result while that hold exists. A retry of `confirm` with the same IDs returns the same result after the confirmation. These retries make no further changes.
168
168
- The `reject` method ends the call with a business result. The caller receives `SolidObjects::Rejected`. The runtime does not retry a rejection.
169
169
@@ -185,6 +185,7 @@ result = EventTickets.ref(event.id.to_s).hold(
185
185
-**Retries:** Two identical holds and two identical confirmations sell one seat.
186
186
-**Confirmation after expiry:** The actor rejects the confirmation with the code `no_hold`.
187
187
-**Past the deadline, before the reminder runs:** The test moves the clock 11 minutes forward and delivers no reminder. The actor rejects the confirmation with `no_hold`, and another buyer holds the seat.
188
+
-**A retry with the same hold ID after the deadline:** the test moves the clock 11 minutes forward. The retry creates a fresh hold, and then the old expiry arrives. The fresh hold stays.
188
189
-**Stale form:** The actor rejects the update with the code `stale_revision`. The next section explains this check.
0 commit comments