Skip to content

[WIP] Fix NPE in WebPush notification handling#24309

Closed
Claude wants to merge 1 commit into
mainfrom
claude/fix-npe-webpush-exception
Closed

[WIP] Fix NPE in WebPush notification handling#24309
Claude wants to merge 1 commit into
mainfrom
claude/fix-npe-webpush-exception

Conversation

@Claude

@Claude Claude AI commented May 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>com.vaadin.flow.server.webpush.WebPush.java#L125 is NPE ("response" is null) instead of WebPushException</issue_title>
<issue_description>### Description of the bug

The line of code https://github.com/vaadin/flow/blob/main/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPush.java#L125
If SubscriptionState status == SubscriptionState.EXPIRED we should throw new WebPushException(
"Sending of web push notification failed with status code 404 or 410");
But instead of WebPushException we catch following Exception :
java.lang.NullPointerException: Cannot invoke "java.net.http.HttpResponse.body()" because "response" is null at com.vaadin.flow.server.webpush.WebPush.sendNotification(WebPush.java:125) ~[flow-webpush-25.1.3.jar:na] at digital.equinox.springcore.data.service.webpush.WebPushServiceImpl.notify(WebPushService.kt:83) ~[classes/:na]

Expected behavior

throw new WebPushException(
"Sending of web push notification failed with status code 404 or 410");

Minimal reproducible example

Just wait until WebPushSubscription is SubscriptionState.EXPIRED state

Versions

  • Vaadin / Flow version: 25.1.3
  • Java version: 21
  • OS version: MacOS Tahoe 26.2 (25C56)
  • Browser version (if applicable): Chrome Version 147.0.7727.138 (Official Build) (arm64)
  • Application Server (if applicable): TomCat
  • IDE (if applicable): IntelliJ IDEA 2025.3

Image</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

Copilot stopped work on behalf of mcollovati due to an error May 9, 2026 10:18
@Claude Claude AI requested a review from mcollovati May 9, 2026 10:18
Copilot stopped work on behalf of mcollovati due to an error May 9, 2026 10:19
@mcollovati mcollovati closed this May 9, 2026
@mcollovati mcollovati deleted the claude/fix-npe-webpush-exception branch May 9, 2026 10:35
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.

com.vaadin.flow.server.webpush.WebPush.java#L125 is NPE ("response" is null) instead of WebPushException

2 participants