Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

A deprecated module dependency in apns integration #47553

Closed
szimszon opened this issue Mar 7, 2021 · 18 comments
Closed

A deprecated module dependency in apns integration #47553

szimszon opened this issue Mar 7, 2021 · 18 comments

Comments

@szimszon
Copy link

szimszon commented Mar 7, 2021

The problem

I try to send a PR about a matrix component (#47529) and test failed on apns component because:

Report from @elupus in discord devs_core:

...The apns project uses apns2 which uses hyper which uses h2... Hyper wants a less than 3.0 version of h2. Matrix wants a larger then 3. This they conflict...

...IMHO this is a bug in apns integration. Hyper is a deprecated package. We can't have core limited by that...

What is version of Home Assistant Core has the issue?

dev branch

What was the last working version of Home Assistant Core?

What type of installation are you running?

Home Assistant Core

Integration causing the issue

apns

Link to integration documentation on our website

No response

Example YAML snippet

# Put your YAML below this line

Anything in the logs that might be useful for us?

# Put your logs below this line
@probot-home-assistant
Copy link

apns documentation
apns source
(message by IssueLinks)

@elupus
Copy link
Contributor

elupus commented Mar 7, 2021

Upstream issue: Pr0Ger/PyAPNs2#74

@szimszon
Copy link
Author

What is the possible path here?

Is there any policy for deprecated libs or will deprecated lib block any new development undefined long unless the apns component will stop working entirely or will switch to a new lib?

@elupus
Copy link
Contributor

elupus commented Mar 11, 2021

We don't really have a policy on this. I brought it up with other devs. And we usually push the maintainer to fix it. But this integration have no marked maintainer. So I'm somewhat at a loss on how to proceed.

@szimszon
Copy link
Author

Thank you for the update @elupus . And thank you to bring this to devs.

@235816
Copy link

235816 commented May 19, 2021

Has there been any progress on this issue?

@szimszon
Copy link
Author

I didn't hear any news unfortunately. ;(

@235816
Copy link

235816 commented May 22, 2021

@elupus Would it be possible to drop the APNS integration due to the deprecated dependency which is blocking other developments? I think that not that many users would be affected by this (if any), because the stats say that no person of the people contributing to the integration stats is using this integration (see https://analytics.home-assistant.io/#integrations).

@235816
Copy link

235816 commented May 22, 2021

Another possibility would be to port the APNS integration to another APNS library.

pyapns_client seems to be a possible replacement for PyAPNs2. It's dependencies can be seen in the project's setup.py.

If I ported the APNS integration to another APNS library, I would not be able to test it, because I neither have an Apple developer account nor any Apple device to test it with.

But frankly, I do want to work on the Matrix integration, and not on another random integration which blocks the work on the Matrix integration.

@235816
Copy link

235816 commented May 22, 2021

I do not think that it helps with the overall issue, but we could adapt the APNS integration to use the latest version of PyAPNs2, as the used version 0.3.0 is quite outdated (version 0.3.0 has been released four years ago in 2017: https://github.com/Pr0Ger/PyAPNs2/releases/tag/0.3.0)

@235816
Copy link

235816 commented May 22, 2021

@sam-io As you added APNS support back in 2016: What do you think about this issue?

@benjmarshall
Copy link

I've found this issue because I've been tracking the ongoing Matrix integration bugs and have just stumbled across @szimszon work to port the integration across to the matrix-nio library, kudos to you!

The issue here has a couple of suggestions for forked PyAPNs2 version which have ported from hyper to httpx. Patching the APNS integration to use one of these forks should be less work than moving to an alternative library such as pyapns_client.

I would like to try and bring @szimszon's matrix-nio branch up to date with home-assistant:dev and test it alongside a patched APNS integration which uses one of these forks.

However I don't have an environment to test the functionality of the APNS integration unfortunately. Does anyone have access to an apple device and developer account and the knowledge required to test this functionality?

@szimszon
Copy link
Author

You have my blessing ;) as I have no time right now to move this forward.

@benjmarshall
Copy link

benjmarshall commented Aug 10, 2021

I've brought @szimszon branch up to date with home-assistant:dev (or at least within a couple of weeks of latest). The updated matrix component still seems to be functional as far as I can tell, more informal testing needed though. You can follow my work here.

And it looks like all apns tests are passing now! I think the previous test failures may have actually been unrelated to the matrix component. "pip check" will show that we don't have the versions of some of the underlying libraries that pyapns2 wants but the tests pass and I can still load the apns integration into home-assistant. This last point has a caveat that I don't have an apple testing environment so I can't load it in and have it functional, i have to spoof the certificate file check for example.

I'm hoping we might be able to proceed from this point independently of the apns integration depreciated libraries issue. Having looked at the couple of branches that have ported pyapns2 to httpx neither have made any start of getting the parent library updated on PyPi. The alternative apns libraries on PyPi look like they would take a bit of work to port the apns integration across too. I have no desire and no testing environment to do this work.

Instead I will try to bring this matrix integration up to date as much as possible by moving it up to the latest version of the matrix-nio library and make sure it is fully working though functional testing. I'll continue to at least check apns component tests pass as I make changes. I will also look at whether I can add basic tests for the matrix component. If I can get this all up to date I will reopen a PR against home-assistant:dev and see if I can get a review started with the core devs again.

@szimszon
Copy link
Author

szimszon commented Sep 3, 2021

Any updates?

@benjmarshall
Copy link

I had been doing some longer term testing on the integration as is and have come across an issue I think I need to fix before opening a PR. The matrix component was not handling an exception being thrown from somewhere inside a dependency (off the top of my head I think it was a connection timeout). This was causing the bot to basically become disconnected and stop working. I think the best way to fix is to simply handle the exception and do re-initialise the connection. However, I had been testing against a personal instance of a matrix homeserver so i wanted to test against a public one too which might have a higher reliability to see if I could reproduce the same thing.

@szimszon
Copy link
Author

szimszon commented Sep 7, 2021

I use it since I created it and never stopped working. ;) Still if it works for the creator doesn't mean it will work elsewhere too :-D

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants