Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: add error message parameter to onError callback in subscription #2987

Merged

Conversation

cromoteca
Copy link
Contributor

Closes #2062.

@cromoteca cromoteca changed the title feat; add error message parameter to onError callback in subscription feat: add error message parameter to onError callback in subscription Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.57%. Comparing base (50822ec) to head (0322682).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2987   +/-   ##
=======================================
  Coverage   92.57%   92.57%           
=======================================
  Files          85       85           
  Lines        3166     3166           
  Branches      776      776           
=======================================
  Hits         2931     2931           
  Misses        183      183           
  Partials       52       52           
Flag Coverage Δ
unittests 92.57% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

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

Generally, this is a nice enhancement, but, isn't it automatically expose some unwanted error messages to the client as well? For instance, when an endpoint method returning a Signal is annotated with @RolesAllowed("ADMIN"), so far, the only thing on client was: "Error in flux ...", and I wonder if this change exposes the the "access denied" error message to the client, and cause a security issue.

Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

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

Just adding this to block merging before the above question is answered.

@cromoteca
Copy link
Contributor Author

Generally, this is a nice enhancement, but, isn't it automatically expose some unwanted error messages to the client as well? For instance, when an endpoint method returning a Signal is annotated with @RolesAllowed("ADMIN"), so far, the only thing on client was: "Error in flux ...", and I wonder if this change exposes the the "access denied" error message to the client, and cause a security issue.

The messages we're talking about here are already on the client. Without a callback, an error is thrown with the contents of the message. With a callback, the message was lost.

If the message contents are an issue on their own, I think that a separate issue should be opened.

@cromoteca cromoteca requested a review from taefi December 17, 2024 08:32
@taefi taefi merged commit aa99331 into main Dec 18, 2024
15 checks passed
@taefi taefi deleted the fix/2062/Include-the-error-in-the-onError-callback-of-Subscription branch December 18, 2024 09:05
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.7.0.alpha3 and is also targeting the upcoming stable 24.7.0 version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include the error in the onError callback of Subscription
4 participants