question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The response of sendNotification may not fulfill

See original GitHub issue

Hi jchambers,

I thought I found another issue. Please take some time to review it when you are available.

It seems the response promise for sendNotification may stay in unfinished state forever when write failure occurs here or here. Because there’s no listener on writePromise to pass any exceptions it got to responsePromise.

I think maybe we can fix this by changing the block start at line 214 in ApnsClient to:

channel.writeAndFlush(responsePromise).addListener(new GenericFutureListener<ChannelFuture>() {

    @Override
    public void operationComplete(final ChannelFuture future) throws Exception {
        if (future.isSuccess()) {
            ApnsClient.this.metricsListener.handleNotificationSent(ApnsClient.this, notificationId);
        } else {
            responsePromise.tryFailure(future.cause());
        }
    }
});

And removes the tryFailure here.

What do you think?

Sorry for not taking PR right now because I may be missing something. So if you agree with the modifications above, I would love to take a PR as soon as possible.

By the way, my enviroment is : jdk: 1.8.0_192 pushy: 0.13.10 netty: 4.1.37.Final tcnative: netty-tcnative-boringssl-static-2.0.25.Final-linux-x86_64

Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jchamberscommented, Feb 9, 2020

I’ve opened #742, which should fix this issue. Your feedback is welcome and greatly appreciated!

2reactions
jchamberscommented, Oct 14, 2019

At a quick glance, I think you may be right. I’ll analyze the situation more carefully as soon as I can. Thanks kindly for the report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SendNotificationResponseMessage | Microsoft Learn
Describes a request that cannot be fulfilled. The following are examples of sources of errors: Invalid attributes or elements; Attributes or elements out...
Read more >
How to handle notification when app in background in Firebase
When app is in background onMessageReceived does not get called and it's a serious issue in FCM!!! Also please update your answer. –...
Read more >
Build app server send requests | Firebase Cloud Messaging
Examples in this page show how to send notification messages using the Firebase Admin SDK (which has support for Node, Java, Python, C#,...
Read more >
How Do I Use the adobe.target.sendNotifications() Function?
Field Name Type Required? Request > notifications Array of Objects Yes Request > notifications > address Object No Request > notifications > address > url String...
Read more >
Sending web push notifications from Spring Boot - Hilla
The answer will be "granted" or "denied". NOTE: If the user declines, you cannot ask them again. Be sure to only prompt the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found