Skip to content

Develop#2

Merged
mathijs-bb merged 3 commits into
mainfrom
develop
May 18, 2026
Merged

Develop#2
mathijs-bb merged 3 commits into
mainfrom
develop

Conversation

@mathijs-bb
Copy link
Copy Markdown
Contributor

Updated connection validation

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8996b59e-cde1-4cdb-afa9-6d66649931aa

📥 Commits

Reviewing files that changed from the base of the PR and between b90cfb3 and 1c03602.

📒 Files selected for processing (1)
  • Apps.Figma/Connections/ConnectionValidator.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Apps.Figma/Connections/ConnectionValidator.cs

Walkthrough

This PR updates connection validation to mark HTTP NotFound (and Unauthorized) as invalid responses alongside Forbidden, and increments the project Version from 1.0.0 to 1.0.1.

Changes

Connection Validation Fix and Release

Layer / File(s) Summary
Connection validation tightens NotFound handling
Apps.Figma/Connections/ConnectionValidator.cs
Adds using System.Net and changes ValidateConnection so responses with Forbidden, NotFound, or Unauthorized are treated as invalid.
Version bump to 1.0.1
Apps.Figma/Apps.Figma.csproj
Project Version updated from 1.0.0 to 1.0.1.

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The pull request title 'Develop' is generic and does not convey the specific changes made in the changeset (version update and connection validation improvements). Use a more descriptive title that captures the main changes, such as 'Update connection validation to handle 401 Unauthorized responses' or 'Bump version and improve HTTP status code handling in connection validation'.
Description check ❓ Inconclusive The description 'Updated connection validation' is vague and lacks detail about what specifically was updated and why. Expand the description to explain the changes, such as what HTTP status codes are now handled, why the change was needed, and any testing performed.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Apps.Figma/Connections/ConnectionValidator.cs`:
- Line 27: The current validation in ConnectionValidator (var isValid =
response.StatusCode != System.Net.HttpStatusCode.Forbidden &&
response.StatusCode != System.Net.HttpStatusCode.NotFound) incorrectly treats
many failure statuses as valid; change the logic to consider only successful
HTTP responses as valid by using response.IsSuccessStatusCode (or checking
StatusCode is in the 2xx range) inside the same method that performs the
request, and ensure you handle a null/failed response appropriately before
checking IsSuccessStatusCode.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f4cc551b-6922-4240-9db2-41fa60614fec

📥 Commits

Reviewing files that changed from the base of the PR and between 3487533 and b90cfb3.

📒 Files selected for processing (2)
  • Apps.Figma/Apps.Figma.csproj
  • Apps.Figma/Connections/ConnectionValidator.cs

var response = await client.ExecuteAsync(request, cancellationToken);

var isValid = response.StatusCode != System.Net.HttpStatusCode.Forbidden;
var isValid = response.StatusCode != System.Net.HttpStatusCode.Forbidden && response.StatusCode != System.Net.HttpStatusCode.NotFound;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Treat only successful HTTP responses as valid connections.

Line 27 still marks several failed responses as valid (e.g., 401, 429, 5xx). Validation should be success-based, not “not 403/404”-based.

Proposed fix
-            var isValid = response.StatusCode != System.Net.HttpStatusCode.Forbidden && response.StatusCode != System.Net.HttpStatusCode.NotFound;
+            var isValid = ((int)response.StatusCode >= 200) && ((int)response.StatusCode < 300);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var isValid = response.StatusCode != System.Net.HttpStatusCode.Forbidden && response.StatusCode != System.Net.HttpStatusCode.NotFound;
var isValid = ((int)response.StatusCode >= 200) && ((int)response.StatusCode < 300);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Apps.Figma/Connections/ConnectionValidator.cs` at line 27, The current
validation in ConnectionValidator (var isValid = response.StatusCode !=
System.Net.HttpStatusCode.Forbidden && response.StatusCode !=
System.Net.HttpStatusCode.NotFound) incorrectly treats many failure statuses as
valid; change the logic to consider only successful HTTP responses as valid by
using response.IsSuccessStatusCode (or checking StatusCode is in the 2xx range)
inside the same method that performs the request, and ensure you handle a
null/failed response appropriately before checking IsSuccessStatusCode.

@mathijs-bb mathijs-bb merged commit f0209dd into main May 18, 2026
2 checks passed
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.

1 participant