Skip to content
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

$includeLinks value for a projection has no effect #3958

Open
hg-jarlinghaus opened this issue Sep 15, 2023 · 2 comments
Open

$includeLinks value for a projection has no effect #3958

hg-jarlinghaus opened this issue Sep 15, 2023 · 2 comments
Labels
kind/bug Issues which are a software defect

Comments

@hg-jarlinghaus
Copy link

hg-jarlinghaus commented Sep 15, 2023

Describe the bug
When using projections, setting $includeLinks to false has no effect and functions the same as $includeLinks: true.

To Reproduce
Steps to reproduce the behavior:

  1. Enable system projections
  2. Insert a few instances of ANY_EVENT_YOU_WANT into a stream
  3. Run the following projection
  options({
    $includeLinks: false,
  }) 
  fromStream("$et-ANY_EVENT_YOU_WANT")
  .when({
    $init: function(state, event) {
      return []
    },
    $any: function(state, event) {
      return [...state, event];
    },
  })
  1. Run the projection again with $includeLinks: true
  2. The results are identical

This applies to all streams with link events not just the system generated ones, that's just the simplest reproduction I thought of.
Expected behavior
I would expect the link events to not appear when $includeLinks is false, and the results to be empty.

Actual behavior
They appear and don't register as link events.

Config/Logs/Screenshots
True
image
False
image

EventStore details

  • EventStore server version: 22.10.2

  • Operating system: Ubuntu

  • EventStore client version (if applicable): N/A

Additional context

Assuming you inserted all the ANY_EVENT_YOU_WANT events into STREAM_A, the state for the example reproduction basically looks as if you ran it against STREAM_A instead of $et-ANY_EVENT_YOU_WANT, except that the link metadata is populated. In other words, it sort of looks like having resolveLinkTos enabled via a client, (the eventType field is ANY_EVENT_YOU_WANT instead of $> for example) which might be causing the unexpected behavior? If that's the case, the resolveLinkTos kind of behavior for link events in projections is a feature I need, so if a fix for this changes that please have some way to preserve the current format of link events in projections.

@hg-jarlinghaus hg-jarlinghaus added the kind/bug Issues which are a software defect label Sep 15, 2023
@ylorph
Copy link
Contributor

ylorph commented Sep 15, 2023

Could you explain why you need access to the link event itself ?

Is tath a change of behavior you noticed ?

note that changing this behavior will potentially break every projections that are currently in use .

@hg-jarlinghaus
Copy link
Author

I don't at this moment have any need to access the link event, I only noticed that the $includeLinks option doesn't actually do what it says it should in the documentation and made a bug report for that. I don't know if the behavior was different at any time before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues which are a software defect
Projects
None yet
Development

No branches or pull requests

2 participants