Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: hotfix legacy endpoints, return an empty list like they always did #1368

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

altergui
Copy link
Contributor

@altergui altergui commented Aug 21, 2024

rather than a "404 page not found" all the legacy endpoints had different behaviours

endpoints that return an empty list
  * GET /accounts/{accountId}/fees/page/{page}
  * GET /accounts/page/{page}
  * GET /chain/organizations/page/{page}
  * POST /chain/organizations/filter/page/{page}
  * GET /chain/transactions/page/{page}
  * GET /chain/blocks/{height}/transactions/page/{page}
  * GET /chain/fees/page/{page}
  * GET /chain/fees/reference/{reference}/page/{page}
  * GET /chain/fees/type/{type}/page/{page}
  * POST /elections/filter/page/{page}
  * POST /elections/filter
  * GET /elections/page/{page}
  * GET /elections/{electionId}/votes/page/{page}

odd endpoints that return {}
  * GET /accounts/{organizationId}/elections/page/{page}
  * GET /accounts/{organizationId}/elections/status/{status}/page/{page}

odd endpoint that returns {"transfers":{"received":[],"sent":[]}}
  * GET /accounts/{accountId}/transfers/page/{page}

the new endpoints are of course unaffected, they still return "page not found":
  * GET /accounts
  * GET /chain/organizations
  * GET /chain/transactions
  * GET /chain/fees
  * GET /chain/transfers
  * GET /elections
  * GET /votes

@altergui altergui marked this pull request as ready for review August 22, 2024 08:15
@altergui altergui force-pushed the hotfix/legacy-pagination branch 2 times, most recently from b0dccf6 to fa89b4b Compare August 22, 2024 08:30
@altergui altergui changed the title api: hotfix legacy endpoints, return an empty list like they always did (WIP) api: hotfix legacy endpoints, return an empty list like they always did Aug 22, 2024
@altergui altergui requested a review from p4u August 22, 2024 08:35
@coveralls
Copy link

coveralls commented Aug 22, 2024

Pull Request Test Coverage Report for Build 10505648397

Details

  • 72 of 246 (29.27%) changed or added relevant lines in 5 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 62.404%

Changes Missing Coverage Covered Lines Changed/Added Lines %
api/vote.go 6 10 60.0%
api/accounts.go 27 49 55.1%
api/elections.go 20 44 45.45%
api/legacy.go 0 49 0.0%
api/chain.go 19 94 20.21%
Files with Coverage Reduction New Missed Lines %
api/elections.go 1 70.29%
Totals Coverage Status
Change from base Build 10476530748: -0.3%
Covered Lines: 16514
Relevant Lines: 26463

💛 - Coveralls

rather than a "404 page not found" all the legacy endpoints had different behaviours

endpoints that return an empty list
  * GET /accounts/{accountId}/fees/page/{page}
  * GET /accounts/page/{page}
  * GET /chain/organizations/page/{page}
  * POST /chain/organizations/filter/page/{page}
  * GET /chain/transactions/page/{page}
  * GET /chain/blocks/{height}/transactions/page/{page}
  * GET /chain/fees/page/{page}
  * GET /chain/fees/reference/{reference}/page/{page}
  * GET /chain/fees/type/{type}/page/{page}
  * POST /elections/filter/page/{page}
  * POST /elections/filter
  * GET /elections/page/{page}
  * GET /elections/{electionId}/votes/page/{page}

odd endpoints that return {}
  * GET /accounts/{organizationId}/elections/page/{page}
  * GET /accounts/{organizationId}/elections/status/{status}/page/{page}

odd endpoint that returns {"transfers":{"received":[],"sent":[]}}
  * GET /accounts/{accountId}/transfers/page/{page}

the new endpoints are of course unaffected, they still return "page not found":
  * GET /accounts
  * GET /chain/organizations
  * GET /chain/transactions
  * GET /chain/fees
  * GET /chain/transfers
  * GET /elections
  * GET /votes
@altergui altergui merged commit 6f4642c into main Aug 22, 2024
26 checks passed
@altergui altergui deleted the hotfix/legacy-pagination branch August 22, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants