Skip to content

[WIP] Fix NPE in WebPush when subscription state is expired#24308

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

[WIP] Fix NPE in WebPush when subscription state is expired#24308
Claude wants to merge 1 commit into
mainfrom
claude/fix-npe-in-webpush

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)

@mcollovati

Copy link
Copy Markdown
Collaborator

@claude[agent] there are no changes in this pr

@sonarqubecloud

sonarqubecloud Bot commented May 9, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the +0.0.1 label May 9, 2026
@mcollovati

Copy link
Copy Markdown
Collaborator

@claude plan and implement the fix

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

Test Results

 1 405 files  ±0   1 405 suites  ±0   1h 19m 53s ⏱️ - 3m 20s
10 137 tests ±0  10 067 ✅ ±0  70 💤 ±0  0 ❌ ±0 
10 612 runs  ±0  10 533 ✅ ±0  79 💤 ±0  0 ❌ ±0 

Results for commit 59e99d6. ± Comparison against base commit ba7d3cb.

@mcollovati mcollovati closed this May 9, 2026
@mcollovati mcollovati deleted the claude/fix-npe-in-webpush 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

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