Skip to content

fix: NPE when web push subscription is expired (CP: 24.10)#24311

Merged
caalador merged 3 commits into
24.10from
cherry/cherrypick-24310-to-24.10
May 11, 2026
Merged

fix: NPE when web push subscription is expired (CP: 24.10)#24311
caalador merged 3 commits into
24.10from
cherry/cherrypick-24310-to-24.10

Conversation

@mcollovati
Copy link
Copy Markdown
Collaborator

When the push service reports a subscription as expired, WebPush.sendNotification threw NullPointerException instead of the intended WebPushException.

Remove a leftover reference to an unassigned HttpResponse local variable that was no longer populated after the migration to com.interaso.webpush.

Fixes #24306

When the push service reports a subscription as expired,
`WebPush.sendNotification` threw `NullPointerException` instead
of the intended `WebPushException`.

Remove a leftover reference to an unassigned `HttpResponse`
local variable that was no longer populated after the migration
to `com.interaso.webpush`.

Fixes #24306
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Test Results

1 289 files  + 1  1 289 suites  +1   1h 19m 21s ⏱️ + 1m 8s
8 901 tests + 2  8 839 ✅ + 2  62 💤 ±0  0 ❌ ±0 
9 312 runs  +70  9 242 ✅ +68  70 💤 +2  0 ❌ ±0 

Results for commit e382d3c. ± Comparison against base commit fc3f13b.

♻️ This comment has been updated with latest results.

@caalador
Copy link
Copy Markdown
Contributor

For some reason the webpush module gets

Error:  org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Error:  java.lang.ClassNotFoundException: com.vaadin.flow.testutil.CurrentInstanceCleaner

on this branch.

@mcollovati
Copy link
Copy Markdown
Collaborator Author

The issue is that the root POM configures a JUnit 4 test listener for the surefire plugin, but the class is in the generic test modules that flow-webpush does not depend on.
Disabling the listener should be enough to fix this

Comment thread flow-webpush/pom.xml Outdated
<version>2.2.21</version>
</dependency>

<!--
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.

The non dependency could be cleaned from the pom as it seems the empty listener property is enough

Comment thread flow-webpush/pom.xml Outdated
@mcollovati mcollovati requested a review from caalador May 11, 2026 10:22
@caalador caalador enabled auto-merge (squash) May 11, 2026 10:25
@sonarqubecloud
Copy link
Copy Markdown

@caalador caalador merged commit fd2adf9 into 24.10 May 11, 2026
26 of 28 checks passed
@caalador caalador deleted the cherry/cherrypick-24310-to-24.10 branch May 11, 2026 10:44
mshabarov pushed a commit that referenced this pull request May 11, 2026
…CP: 24.9) (#24319)

This PR cherry-picks changes from the original PR #24311 to branch 24.9.
---
#### Original PR description
> When the push service reports a subscription as expired,
`WebPush.sendNotification` threw `NullPointerException` instead of the
intended `WebPushException`.
> 
> Remove a leftover reference to an unassigned `HttpResponse` local
variable that was no longer populated after the migration to
`com.interaso.webpush`.
> 
> Fixes #24306
>

Co-authored-by: Marco Collovati <marco@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants