posit-dev / posit-dev/connectapi

refactor: remove __ping__ request

Open
#427 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

size:sm
Dominant language
R
Stars
54
Forks
27
Avg merge
1d 3m
Merged PRs (30d)
1

Description

check_connect_license() calls the __ping__ endpoint and looks for 402 response to indicate that the license is not valid. But we don't need to do that because any request will error that way if the license is invalid. So just move the special messaging for 402 errors into Connect$raise_error() and delete this unnecessary server request.

Also delete the various __ping__.json test mock files, as they are no longer needed.

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.

Research direction

Start in R/utils.R at check_connect_license() and in R/connect.R at Connect$raise_error() to trace the current 402 handling. Remove the ping request, centralize its special messaging in raise_error(), and delete the various ping.json test mock files. Done means invalid-license errors retain the special message without an extra request and the affected tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
api, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.