Skip to content

Commit

Permalink
[lib] correctly skip using established socket when urlPrefix is overr…
Browse files Browse the repository at this point in the history
…iden

Summary:
In D9667, I got some feedback about improving the solution for not using an established socket for calling endpoints whenever we override the `urlPrefix`. This diff addresses that feedback.

Depends on D9667

Test Plan:
Created this dummy params override object:

```
    const dummyOverride = {
      urlPrefixOverride: 'testing',
    };
```

And passed it to endpoint calls that would normally use an established socket and confirmed that when we overrode the url prefix with this dummy params override object we were not entering the condition in `callServerEndpoint` where we use an established socket

Reviewers: inka, michal, rohan, ashoat

Reviewed By: inka, ashoat

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9673
  • Loading branch information
ginsueddy committed Dec 12, 2023
1 parent 842832e commit 3889649
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils/call-server-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ async function callServerEndpoint(
if (
endpointIsSocketPreferred(endpoint) &&
connectionStatus === 'connected' &&
socketAPIHandler
socketAPIHandler &&
!options?.urlPrefixOverride
) {
try {
const result = await socketAPIHandler({ endpoint, input });
Expand Down

0 comments on commit 3889649

Please sign in to comment.