feat(compat): say which feature and version a request needs, and document the version axis - #820
Merged
Merged
Conversation
A request an older PoracleNG cannot serve arrived either in that server's own wording, which names a database column, or as a generic 500. PoracleUnsupportedException carries a plain feature name and what the server would need, in words, and the global PoracleUnsupportedExceptionFilter answers 409 with both. 409 rather than 403: the 403 branch is the disable_* path and keys off disableKey. An old server is not a switched-off feature, and borrowing that shape would put both behind the same toast while losing the one detail worth reading. 409 has no interceptor branch, so it falls through to the caller and lands beside the control that asked -- the route TrackingConflictExceptionFilter already takes. It carries a feature name and a version, not a registry key. Support is decided per feature by IPoracleServerProfileService and small services on top of it, so there is nothing central to look a key up in, and the words are what the reader sees. Nothing throws it yet. Rewrites the PoracleNG compatibility page, whose premise was that PoracleNG keeps two long-lived branches. Develop shipped as 5.2.1 and merged; the axis is 5.1.0 versus 5.2.1+. Records two traps verified against live 5.1.0 and 5.2.1 servers: the v1 API is unchanged on 5.2.1, so the RFC 9457 bodies and 422 codes in its release notes apply to v2 only; and its OpenAPI declares active_hours.day as 0-6 "0=Sunday" while the scheduler uses ISO weekdays 1-7.
The page said no `description` field appears on any tracking rule schema on 5.2.1. It does. A v2 read takes `?include_descriptions=true` and returns a `description` per rule -- the same sentence the bot answers `!pokemon` with -- and v1's `allProfiles` accepts the same flag. The mistake is worth recording rather than just fixing, so the page now says how to avoid it: `description` is absent from the named `V2PokemonRule` request schema, and the envelope carrying it is an inline object under `rules.items` rather than a named component, so searching `components/schemas` finds nothing. Resolve `V2ListOutput...Body.properties.rules.items` before concluding a field is absent. Also corrected two claims that the branches in review have overtaken: costume is not blocked on the missing name list (the picker reads the same WatWowMap masterfile PoracleNG reads, which is why the names are English everywhere), and the features table now lists rule descriptions.
…equest-surface # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted from the abandoned
feat/poracleng-two-branch-support, plus the compatibility documentation that branch was carrying. Independent of the other open PRs; can go in any time.Why the parent branch was abandoned
Its premise — that PoracleNG keeps two long-lived branches and this application should serve both — died when PoracleNG's
developshipped as 5.2.1. The real axis is 5.1.0 versus 5.2.1+.Its foundation was also already here.
PoracleServerProfileandPoracleServerProfileServiceare on develop, andISummaryCapabilityServicealready establishes the per-feature capability-service shape the 5.2.1 feature branches went on to follow.PoracleCapabilityService/PoracleCapabilityKeyswere a competing second design for an idea that already had one, which is how a codebase ends up with two implementations and one of them lying.The abandoned work is preserved at
3d33b35on that branch. Two pieces were worth keeping; this is one of them (quest pokécoins is the other, separately).Part 1 — a request an old Poracle cannot serve now says so
PoracleUnsupportedExceptioncarries a plain feature name and a required version, not a registry key — that was the rework needed to drop the registry dependency.PoracleUnsupportedResponseputs the 409 body in one place, mirroringFeatureDisabledResponse, so the wire format cannot drift. The filter registers globally beside the other five.Five tests, matching
FeatureDisabledExceptionFilterTests: the mapping, the message naming both feature and version, that it emits neither adisableKeynor a 403, that it ignores unrelated exceptions, and that it declinesFeatureDisabledException— both filters run on every request, so each has to leave the other's exception alone.No SPA interceptor branch, deliberately.
error.interceptor.tshas no 409 handling at all, and that absence is already load-bearing:TrackingConflictExceptionFilterreturns 409 and the alarm dialogs show its message beside the control. Adding a branch here would replace a useful sentence ("requires PoracleNG database migration 6") with a generic toast, and copying the 403disableKeypath would conflate an operator's switch with an old server. The reasoning is in the filter's remarks and asserted by two of the tests.Nothing throws this yet, so there is no user-visible change today. The changelog entry says exactly that.
Part 2 — the compatibility page
docs/architecture/poracleng-compatibility.md, rewritten from scratch, registered inmkdocs.ymland linked fromdocs/index.md.Claims were re-verified against live 5.1.0 and 5.2.1 servers rather than carried over:
{"message":...,"status":"error"}byte-identical on both. The RFC 9457 problem+json bodies and 422 statuses in its release notes are/api/v2only. Assuming otherwise cost a wrongly-framed issue and PR earlier in this batch, so it is written down.active_hoursday numbering from the v2 schema. It declaresdayas 0–6, "0=Sunday", while the scheduler uses ISO Monday 1 to Sunday 7. It rejects Sunday and accepts a meaningless 0.0.0.0./healthcapability map gained exactly one key on 5.2.1 (derivedDtsTypes) and says nothing about alarm columns, so reaching forSupports()whereHasSchema()is the question answers false forever.Three claims from the old page were dropped rather than repeated, because they could not be verified: that
diff.gois byte-identical between versions, and thedisabledHookspokestop-versus-fortdifference (both dev servers report an empty array).One correction I made on top of the extraction
The first pass concluded no
descriptionfield exists on any 5.2.1 tracking-rule schema, and left rule descriptions out of the feature table. It does exist —?include_descriptions=trueis a documented query parameter and the envelope carriesdescription. It is missing from the namedV2PokemonRulerequest schema, and the response envelope is an inline object underrules.itemsrather than a named component, so searchingcomponents/schemasfinds nothing. The page now records how to avoid that specific mistake, since PR #819 depends on the field existing.Also corrected: the page said costume was blocked on PoracleNG publishing no costume-name list. PR #815 solved that by reading the same WatWowMap masterfile PoracleNG itself reads, which is why those names are English in every language.
Verification
Backend 2135 passed, five of them new. No SPA files touched.