Skip to content

GraphQL slice (#356): minor polish — empty-path guard and PVA charset table #366

Closed

Description

@gilesknap

Two small follow-ups noticed while reviewing PR #360 commit e5217785 (slice #356).

1. if api.path: guard in GraphQLTransport.connect is dead code

# src/fastcs/transports/graphql/transport.py
for api in controller_apis:
    if api.path:
        validate_graphql_id(api.path[0])
self._server = GraphQLServer(controller_apis)

If a controller_api.path is empty, validation is silently skipped — but GraphQLServer._create_app immediately does id = controller_api.path[0], which raises IndexError. The guard buys nothing.

The other three transports' connect methods (RestTransport, EpicsCATransport, EpicsPVATransport) all call path[0] unconditionally and would also fail on an empty path — fail-fast there, opaquely deeper here. (The empty-path case itself is already tracked: any snippet that drops pv_prefix but doesn't call set_id would fail at runtime; #363 covers the snippet side.)

Suggested fix: drop the if api.path: guard so GraphQL fails fast at the same boundary as the others. If we ever decide empty paths should be tolerated, that's a foundation-level decision that belongs in FastCS.__init__, not per-transport.

2. Charset table missing PVA's 60-char PV name limit

docs/how-to/multiple-transports.md (the new "Choosing controller ids across transports" section, also added in this slice) shows the limit for CA but not PVA, even though validate_pva_id (slice #355) enforces the same 60-char ceiling:

| EPICS CA  | `[A-Za-z0-9_-]+`, plus the 60-char PV name limit |
| EPICS PVA | `[A-Za-z0-9_-]+` |

Either repeat the 60-char note on the PVA row or hoist it to a sentence under the table that calls out "both EPICS transports also enforce a 60-character PV-name ceiling on the longest derivable prefix."

Both are small; bundling here so they don't each need their own issue.

Activity

  1. self-assigned this
    on May 6, 2026
  2. gilesknap commented on May 6, 2026

    @gilesknap
    ContributorAuthor

    PR #360 commit 207d68d8 (slice #357 Tango) added the missing 60-char note to the PVA row of the charset table in docs/how-to/multiple-transports.md as a drive-by — that half of this issue is closed.

    The remaining half is the GraphQL if api.path: dead-code guard.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions