Skip to content

throw ShareNotFound when share id is not an integer - #39873

Merged
phil-davis merged 1 commit into
masterfrom
fix-issue-39868
Mar 14, 2022
Merged

phil-davis merged 1 commit into
masterfrom
fix-issue-39868

Conversation

@phil-davis

@phil-davis phil-davis commented Mar 12, 2022 •

Copy link
Copy Markdown
Contributor

Description

Throw ShareNotFound early when share id is not an integer, rather than attempting to query the database.

Both share-providers only work with integer share-ids. I added the check to both of them, rather than to some higher-level common code, because it is possible that another future share provider could implement share-ids with a different format.

Related Issue

How Has This Been Tested?

CI - see PR #39872 - that runs acceptance tests with pgsql and demonstrates the fails before the code fix, and that it passes after the code fix.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@jvillafanez jvillafanez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny optional comment


public function getShareByIdNotExistProvider() {
return [
[1],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need a short comment to explain why this is case is expected to fail.

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.

shareAccessByID tests fail on pgsql 10.3

2 participants