fix(marketplace): avoid inventory desync on failed offer insert

Expose whether a marketplace offer was persisted before mutating inventory state, refuse sells whose database insert failed, and synchronize the sold timestamp into the online seller's in-memory offer when present. This keeps failed or racing marketplace operations from desynchronizing credits/items.
This commit is contained in:
simoleo89
2026-06-09 22:02:53 +02:00
parent 8161e3d7e5
commit 19cde45d3e
3 changed files with 29 additions and 2 deletions
@@ -0,0 +1,13 @@
package com.eu.habbo.habbohotel.catalog.marketplace;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
class MarketPlaceOfferContractTest {
@Test
void exposesPersistenceState() {
assertDoesNotThrow(() -> MarketPlaceOffer.class.getDeclaredMethod("isPersisted"));
}
}