Keep candidates found at a rename's revision when clearing offers
A candidate search that read a dinner after its rename committed could store fresh offers that the rename's own clear then dropped, so a valid candidate for the renamed dinner was refused with a 400. clearOffers now takes the revision below which offers are stale: a rename passes its committed revision, so it drops only offers and in-flight searches from earlier revisions, while grounding by hand and archiving pass math.MaxInt64 and clear everything as before. A search finishing late at an earlier revision no longer replaces offers already found at a later one. Fixes MQ-103-02. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,14 @@ func (s *Service) HasOffers(id string) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
// StoreOffers stores urls as dinner id's offers, as a Candidates search
|
||||
// that read the dinner at grounding_revision revision would on finishing.
|
||||
func (s *Service) StoreOffers(id string, urls map[string]string, revision int64) {
|
||||
keep, done := s.trackOffers(id)
|
||||
defer done()
|
||||
keep(urls, revision)
|
||||
}
|
||||
|
||||
// OfferCount is the number of dinners whose candidates the service holds.
|
||||
func (s *Service) OfferCount() int {
|
||||
s.offersMu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user