Skip to content

Conversation

@pawelangelow
Copy link
Collaborator

Description

Currently, there’s a bug that causes the connection check to appear as successful 0.
The expected outcome is either successful 1 or failed 1 - i.e., one definitive result per source.

Screenshot 2025-10-30 at 13 28 02

The root cause is missing backward compatibility handling. Specifically, there are a few scenarios that need to be covered:

  • Older RDI versions (below 1.6.0) that don’t support testing source connections - the API returns 405.
  • Runtime errors on the RDI side - unrelated to the actual connection status.

This PR addresses these cases by:

  • Handling errors per source instead of failing the whole batch.
  • Returning meaningful error messages for unsupported RDI versions (405) or when some other error occurred.
  • Ensuring that successful sources are still reported correctly, even if others fail.

After

Screenshot 2025-10-30 at 13 37 03
  • source2 - is an expected connection problem, so it's properly reported as failing
  • source - is handled by the changes here, as RDI has a problem reporting the connection status (a.k.a. runtime error)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors error handling for testing RDI source connections to provide more granular feedback. Instead of catching all errors at the top level and silently ignoring them, the code now handles errors per-source and differentiates between unsupported RDI versions (405 errors) and actual connection failures.

Key Changes:

  • Error handling moved from try-catch wrapper to per-source error handling within the Promise.all map
  • 405 status code now returns a user-friendly message indicating RDI version upgrade is needed
  • Other errors return a generic "Failed to test source connection" message
  • Early return added when no sources are configured

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
api.rdi.client.ts Refactored testConnections method to handle source connection test errors individually rather than globally, with specific handling for 405 responses
api.rdi.client.spec.ts Added comprehensive test coverage for the new error handling behavior including single/multiple source failures and mixed error scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.24% 20146/24497
🟡 Branches 67.68% 8725/12892
🟡 Functions 76.39% 5360/7017
🟢 Lines 82.65% 19723/23864

Test suite run success

5229 tests passing in 681 suites.

Report generated by 🧪jest coverage report action from dda7a61

Copy link
Collaborator

@ArtemHoruzhenko ArtemHoruzhenko left a comment

Choose a reason for hiding this comment

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

lgtm

sources[source] = {
connected: false,
error:
'Testing source connections is not supported in your RDI version. Please upgrade to version 1.6.0 or later.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we promote latest version instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll merge it this way, as I showed the texts to @ViktarStarastsenka. Honestly, I don't expect this message to be seen that much, as the RDI team is pushing for a lot of releases.

@pawelangelow pawelangelow merged commit 70c2306 into main Oct 31, 2025
39 checks passed
@pawelangelow pawelangelow deleted the feature/RI-7659/fix-testing-connections-rdi branch October 31, 2025 07:04
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.

4 participants