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
fix(history): purchase_history rows stamped convertible while the class setting was standard stay unsellable #524
Before merged #509, savePurchaseHistory hard-coded convertible into purchase_history.offering_class for the legacy ec2 slug. Rows written while the global offering class was standard say convertible but are Standard, so they cannot be sold on the marketplace.
Stamp: internal/purchase/execution.go:961 (now the configured class).
Guard: internal/api/handler_marketplace.go:113isKnownNonStandardOfferingClass (defined :492) returns 400, and the UI hides Sell.
Lazy re-stamp for empty class: populateOfferingClass (internal/api/handler_marketplace.go:308).
Failure scenario
Every AWS ec2 row written while global_config.offering_class='standard' (from the class setting's introduction, commit 425bc2f, 2026-07-17, until #509) is stored as convertible but is Standard. The user cannot sell a Standard RI they own. Global config history is not stored, so the true class can only come from AWS.
Options (owner decision)
a. UPDATE purchase_history SET offering_class = NULL WHERE provider='aws' AND service IN ('ec2','compute') AND offering_class='convertible', so populateOfferingClass re-fetches and re-stamps lazily. Cost: genuinely Convertible rows show a Sell button that 400s once.
b. One-off job calling FetchOfferingClass per row.
Also
On an idempotent re-drive the stamp records the class configured at retry time, not the class bought. Needs an "already existed" signal on the go library's PurchaseResult; the linked go issue will be filed separately.
Activity
IAmJSD commentedon Oct 19, 2026
Claiming: working on this