Endpoint._make_request namespace detection guard misses text/xml responses

Open
#1,866 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start in tableauserverclient/server/endpoint/endpoint.py at Endpoint._make_request and compare its Content-Type guard with TSC’s XML_CONTENT_TYPE constant. Review #1046 and PR #1863 to determine whether namespace detection remains needed; done means the chosen path is covered for the relevant XML response type or the obsolete subsystem is removed consistently.

Written by the indexing model from the issue text.

Description

Endpoint._make_request (in tableauserverclient/server/endpoint/endpoint.py) parses the response Content-Type and calls the namespace-detection helper only when it matches:

if content_type == "application/xml":
    self.parent_srv._namespace.detect(server_response.content)

Tableau Server emits text/xml (which is what TSC's own XML_CONTENT_TYPE constant is set to), so _namespace.detect() never fires from this path. The pre-existing sign-in path called _namespace.detect() explicitly, so the pre-8.3 namespace fallback still worked there; PR #1848 routes signin through _make_request, which now exposes the bug for signin traffic too.

Two things worth thinking about together:

  1. The immediate fix: widen the guard to accept both application/xml and text/xml, or (cheaper) just check "xml" in content_type since detection is idempotent and cheap.
  2. Is the code even reachable? The namespace fallback exists to accept pre-Tableau-8.3 servers that used http://tableausoftware.com/api instead of http://tableau.com/api. TSC's minimum_supported_server_version is 2.3, which corresponds to Tableau Server 10.0 (2016). Any server old enough to emit the pre-8.3 namespace is far below the minimum. See #1046 and PR #1863 for a proposed removal of the whole detection subsystem.

If PR #1863 lands, this issue is moot (the whole _namespace.detect call and the Namespace class go away). If it doesn't, we need to fix the guard.

Filed after a fresh-eyes review flagged the guard on PR #1848.

Dominant language
Python
Stars
716
Forks
446
Avg merge
8d 8h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tableau/server-client-python

All issues in tableau/server-client-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.