Skip to content

fix subscriptuon bug - #442

Open
aheiner2001 wants to merge 1 commit into
ash-project:mainfrom
aheiner2001:main
Open

fix subscriptuon bug#442
aheiner2001 wants to merge 1 commit into
ash-project:mainfrom
aheiner2001:main

Conversation

@aheiner2001

@aheiner2001 aheiner2001 commented Jun 4, 2026

Copy link
Copy Markdown

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@zachdaniel

Copy link
Copy Markdown
Contributor

@barnabasJ could you potentially take a look at this? Looks reasonable to me.

@barnabasJ barnabasJ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@aheiner2001 the new test is already green with the resover / batcher implementation from main. could you describe what problem you were trying to solve exactly?

@aheiner2001

aheiner2001 commented Jun 9, 2026

Copy link
Copy Markdown
Author

@barnabasJ .I was fixing issue #354: when a subscription DSL filter excludes an event, the subscriber should get nothing, not data: null with a not_found error. On main, the new test already passes because the batcher suppresses not_found before publish, even though the resolver still treats filter exclusion as NotFound. My change makes exclusion mean “drop” in the resolver ({:ok, nil}) and updates the batcher so null-only payloads aren’t sent either — those two parts need to work together.
I used the reproduction repo provided

@barnabasJ

Copy link
Copy Markdown
Contributor

NotFound

Ah, I missed the referenced issue, I'll have another look over the weekend

@barnabasJ

Copy link
Copy Markdown
Contributor

@aheiner2001 I had another look at the issue as well, but couldn't really reproduce it. Were you able to make it fail locally the way the issue is described?

I don't necessarily see a problem with the changes, but it would be great to have a test that actually triggers the issue mentioned.

@aheiner2001

aheiner2001 commented Jun 22, 2026

Copy link
Copy Markdown
Author

@barnabasJ
Yes, I was able to reproduce the error using the repoduction repository. Here is the screen shot of the tests.

From what I can see, this is the initial bug reported.
image

@barnabasJ

Copy link
Copy Markdown
Contributor

@aheiner2001 looked at the reproduction repo, and I think the actual issue is in the igniter installer

{:ok, Igniter.Code.Common.add_code(zipper, "use Absinthe.Phoenix.Endpoint")}
the installer adds the regular Absinthe endpoint, but it should add AshGraphql.Subscription.Endpoint, otherwise our filter logic will not run.

… run

The installer added "use Absinthe.Phoenix.Endpoint", which doesn't
delegate run_docset/3 to AshGraphql.Subscription.Runner, so the
subscription batcher/filter logic never ran in generated apps. This
caused filtered-out subscription events to be delivered as null +
not_found (issue ash-project#354).
@aheiner2001

Copy link
Copy Markdown
Author

@barnabasJ You're right — I've reverted my initial changes and implemented the ones you suggested.

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.

3 participants