Skip to content

Updaters — One-Shot Corrections

A one-time data correction is a leg of the platform, not a hand-keyed mongosh script: the code lives in the service that owns the data, so it passes through the same conversions, aliases and pricing a normal write does, and it is triggered per environment by hand.

The chain

admin console   UpdatersView  (/updaters)
  └─ admin  UpdaterService  (extends WsProxy — forwards the caller's token)
       └─ Feign  webservice-api-v1  UpdaterResources
            └─ webservice  POST /updater/*   @Secured("ROLE_ADMIN")
                 └─ the leg: webservice's own UpdaterService, or a Feign call to the owning service
Route (webservice) Leg What the leg did
POST /updater/w-s webservice UpdaterService.updateWs reset every user to FREE, then refreshed user.usage
POST /updater/findata findata → UpdaterResource (POST /v2/updater) typed the pre-type OHLCV rows, seeded the rebrand aliases, rewrote a year of daily rows
POST /updater/core core → PricesRepairResources (POST /jobs/repair/prices) re-priced the transactions the exchanges reported without usable quotes

Not every leg is an Updater* class: the route belongs to webservice, the leg keeps whatever shape its own service already uses — core's was a jobs resource.

State: all three legs have run and are retired. Their code is deleted and every route above stays with an empty body (it logs [UPDATER] … retired: nothing to do), so the admin console and the -api contracts keep their shape. A new correction adds a leg to this chain; it does not restore these.

Which leg ran

The route logged [UPDATER] Calling … endpoint in webservice, and the callee logged its own summary ([Repair] Prices repair done, N closed orders re-priced). A retired route logs [UPDATER] … is retired: nothing to do. A button that appears to have done nothing is usually the wrong route: /updater/w-s is not /updater/core.

Rules

  • The leg belongs to the owning service. Reading another domain directly is fine; writing it by hand is not: a script skips the service's own conversion, alias and pricing rules, and cannot be re-run safely.
  • Idempotent, and only after its deploy. The code travels in the image, so it can run only once that release is in the environment — while the read path that depends on it is already live and answers empty until then. State the window out loud: deploy, then run.
  • Temporary by construction. A leg is spent data plus a code path nobody will re-run: once it has run in prod the code is deleted, and its endpoint stays with an empty body so the route, the -api method and the admin button keep their shape. The task that shipped the leg keeps its delete the leg after the prod run box open until then — that box is the reminder, so the deletion is never left to memory.
  • The admin console is not a deploy step. Nothing in this chain is part of a release: it runs by hand, per environment, after the deploy.