Skip to content

Enhance remote flow sources for CAP #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 17, 2025

Conversation

knewbury01
Copy link
Contributor

@knewbury01 knewbury01 commented Jul 14, 2025

New approach

This PR refactors the remoteflowsource types to a simpler type that captures explicit known exposed service handlers OR general event handlers that are registered but not necessarily tied to services

This PR also enhances unit tests for the different ways that handlers can be specified

Old (deprecated) approach

this PR aims to address the following previously missing scenarios:

  • CDS compiles fail and therefore JS event handlers are paired to unknown CDS entities
  • the event handler is registered as an every service handler (example this.on ('UPDATE', '*', req => {...}))

specifically the PR:

  • adds test cases to cover cap event handler registrations that were previously missing in the scenarios listed above
  • add remote flow source type to cover the listed cases of event handler registration

the current approach enumerates over service + event handler pairing cases and follows closely with the previous technique of adding remote flow sources as event handler request objects

an alternative potential approach would be to consider making ServiceInstance more responsible for its event handler registration (if we can assume that all/base service types may have event handlers) and then make their request object params exposed on the implementing types (and still extend RemoteFlowSource)
this approach may be more assured to cover all ways of specifying services and their handlers/looks more generic
But may not make sense if many implementing types are redundant or do not indeed allow event handler registration

add test cases to cover cap event handler
registrations that were previously missing
add remote flow source type to cover more cases
of event handler registration
@knewbury01 knewbury01 requested a review from jeongsoolee09 July 14, 2025 21:04
@knewbury01 knewbury01 self-assigned this Jul 14, 2025
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

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

First round of review.

add more testcases for all entity spec scenarios
add extra ability to know name in one case for ServiceinCDSHandlerParameterWithName
@knewbury01 knewbury01 requested a review from jeongsoolee09 July 16, 2025 15:22
refactor remoteflowsources
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

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

Two more minor points to go!

Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for your work!

@jeongsoolee09 jeongsoolee09 enabled auto-merge July 17, 2025 18:01
@jeongsoolee09 jeongsoolee09 merged commit 3214290 into main Jul 17, 2025
5 checks passed
@jeongsoolee09 jeongsoolee09 deleted the knewbury01/fix-service-handler branch July 17, 2025 18:11
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.

2 participants