Skip to content

fix(multi-video-player): use more specific path split in fromPullUrl#1604

Merged
Jade Fauvelle (Skyzreal) merged 4 commits into
masterfrom
fix/multi-video-player-url-path-duplication
Dec 8, 2025
Merged

fix(multi-video-player): use more specific path split in fromPullUrl#1604
Jade Fauvelle (Skyzreal) merged 4 commits into
masterfrom
fix/multi-video-player-url-path-duplication

Conversation

@Skyzreal
Copy link
Copy Markdown
Contributor

@Skyzreal Jade Fauvelle (Skyzreal) commented Dec 3, 2025

Change fromPullUrl to split on '/jet/jrec/pull/' instead of '/pull/' to properly support reverse proxy deployments with path-based routing

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 3, 2025

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copy link
Copy Markdown
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

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

question: Shouldn’t the base URL be everything that is before /jet? E.g.: gatewayUrl = https://gw1.somedomain.ninja:7000/

Comment thread webapp/packages/multi-video-player/src/gateway-api.ts Outdated
@Skyzreal Jade Fauvelle (Skyzreal) force-pushed the fix/multi-video-player-url-path-duplication branch 2 times, most recently from 89f0e21 to 5c82063 Compare December 5, 2025 17:00
Copy link
Copy Markdown
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

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

Upon re-reviewing this, I’m going to push back on changing the public API here.

The current shape of the API is deliberate: GatewayRecordingApi takes a Gateway base URL and knows internally that the relevant endpoints live under /jet/jrec, /jet/sessions, etc. In other words, callers give it "the thing closest to the real base" (e.g. https://gw1.somewhere.ninja/), and the class owns the knowledge of /jet/… paths.

Switching the constructor to take a jetApiUrl (e.g. https://gw1.somewhere.ninja/jet/) moves those details into the caller. That’s an abstraction leak.

On the /jet/jrec "duplication" point: I don’t really see a concrete problem there. Yes, we repeat /jet/jrec in several methods, but in this case I’d rather be explicit than DRY:

  • Each method clearly shows the full path it is calling.
  • There’s no confusion about which endpoints live where.
  • The gain from refactoring this into a shorter base (jetApiUrl) is small, while the cost in terms of API semantics and abstraction is somewhat high (especially, both the old and new APIs still take a string, but the value must be carefully updated; this is a silent breaking change).

So I don’t think changing the public API just to avoid repeating /jet or /jet/jrec is worth it.

That said, it seems to me that fromPullUrl on master is buggy: fromPullUrl should derive the Gateway base URL (everything before /jet), and currently it seems to split at /pull instead of /jet. But maybe I’m misunderstanding the split method of JavaScript. Can you confirm that?

If you’re OK with that direction, I would be happy to review a follow-up that only adjusts fromPullUrl and leaves the constructor signature and responsibilities as they are.

@Skyzreal Jade Fauvelle (Skyzreal) force-pushed the fix/multi-video-player-url-path-duplication branch from 5c82063 to 4c19155 Compare December 8, 2025 14:11
@Skyzreal
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback Benoit!
I’ve updated only fromPullUrl instead so it derives the correct base URL without needing to strip path segments after.
You're definitely right, and it avoids manipulating the base URL directly, this is more simple than my previous approach as well :)

…uction

Refactor GatewayRecordingApi to use the jet api base (/jet) instead of the jrec endpoint (/jet/jrec) as the base URL.

fix(multi-video-player): remove duplicate path segments in URL construction
@Skyzreal Jade Fauvelle (Skyzreal) force-pushed the fix/multi-video-player-url-path-duplication branch from 4c19155 to d472540 Compare December 8, 2025 15:57
…uction

Refactor GatewayRecordingApi to use the jet api base (/jet) instead of the jrec endpoint (/jet/jrec) as the base URL.
…duplication' into fix/multi-video-player-url-path-duplication
Comment thread webapp/packages/multi-video-player/src/gateway-api.ts Outdated
Copy link
Copy Markdown
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@CBenoit
Copy link
Copy Markdown
Member

Please, update the PR title / body to reflect the changes, and feel free to merge yourself 👍

@Skyzreal Jade Fauvelle (Skyzreal) changed the title fix(multi-video-player): remove duplicate path segments in URL construction fix(multi-video-player): use more specific path split in fromPullUrl Dec 8, 2025
@Skyzreal Jade Fauvelle (Skyzreal) merged commit 288089e into master Dec 8, 2025
40 checks passed
@Skyzreal Jade Fauvelle (Skyzreal) deleted the fix/multi-video-player-url-path-duplication branch December 8, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants