Skip to content

Tracking reads, creates and deletes still use v1 where 5.2.1 already serves v2 #860

Description

@hokiepokedad2

Only the edit path uses /api/v2. Everything else the tracking proxy does is still v1, even though 5.2.1 — the version running everywhere — already serves a v2 equivalent for five of the six calls.

PoracleTrackingProxy line v2 equivalent, live on 5.2.1
GET /api/tracking/{type}/{id} 72 GET /v2/humans/{id}/tracking/{type}
POST /api/tracking/{type}/{id}?silent=true 93 POST /v2/humans/{id}/tracking/{type}
DELETE .../byUid/{uid}?silent=true 174 DELETE /v2/.../tracking/{type}/{uid}
POST .../delete?silent=true 195 DELETE /v2/.../tracking/{type}?uid=a,b
GET /api/tracking/all/{id} 208 GET /v2/humans/{id}/tracking
GET /api/tracking/allProfiles/{id} 220 none

PoracleHumanProxy has the same gap in miniature: start and stop are still v1 while enable and disable already try v2.

This is wider than it looks

The v2 read shape is not the v1 read shape, and 26 files consume the v1 one. Three differences, all load-bearing:

Wildcards come back as null. v1 returns the stored sentinel ("size": -1, "rarity": -1, "costume": 9000); v2 returns null and expects omission on the way back. Anything comparing a read against a stored value — TrackingUpdateReconciler, TrackingFieldPreserver, CleaningService's fetch-mutate-POST, QuickPickService — is comparing different things depending on which surface answered.

Enums are strings. team: 4 becomes team: "any", gender and rsvp_changes likewise. TrackingV2Translator already has the tables for the write direction; the read direction has nothing.

The create response is a different document. v1 answers {"newUids":[7],"alreadyPresent":0,"updates":1,"insert":0} and TrackingCreateResult parses exactly that. v2 answers {"created":[{…,"uid":36535}],"updated":[],"unchanged":[]} — richer, and it names the rules rather than counting them, which would let BulkUidRemap stop pairing on content.

Do #227 first

POST /v2/…/tracking/pokemon inherits v2's validation, which is the problem #835 solved for edits and which is unsolved for creates. pokemon_id is declared required, minimum 1, so every !track everything rule becomes uncreatable — 653 of them exist here. Moving creates before jfberry/PoracleNG#227 lands would break a feature that works today.

Reads and deletes have no such dependency and can go first.

Suggested order

  1. Deletes. Smallest surface, no response shape to reinterpret, and the v2 bulk form takes ?uid=a,b,c which is what we already build.
  2. Reads, behind the same per-server capability check the write path uses, with one normaliser turning a v2 rule back into the v1 shape the services expect. Normalising at the proxy boundary keeps the change to one file instead of twenty-six. GET /v2/humans/{id}/tracking was measured slower than the v1 call it would replace (50ms/189KB against ~24ms), so the all-tracking read is worth benchmarking before adopting rather than assuming it is an improvement.
  3. Creates, once fix(quick-picks): Rocket Leaders pick sent gruntType=mixed (#221) #227 is resolved.

Watch for

Do not normalise in the services. Twenty-six files consuming two shapes is how a read-path migration turns into a year of one-off bugs. One normaliser, at the proxy, with the v1 shape as the internal contract.

The allProfiles read has no v2 route at all, so the profile overview page stays on v1 regardless. Whatever is built has to keep both surfaces working rather than assuming a clean cut.

?silent=true has to survive. v1 takes it as a query parameter on every write; confirm the v2 routes honour the same suppression before moving anything that writes, or every migrated delete starts DMing users (#848 was exactly this bug on the v1 path).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2-migrationBlocked from develop; lands on feat/v2-migration only

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions