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

Pulse breaks Watch Connectivity after opening #201

Closed
ptxmac opened this issue Jun 13, 2023 · 6 comments
Closed

Pulse breaks Watch Connectivity after opening #201

ptxmac opened this issue Jun 13, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@ptxmac
Copy link
Contributor

ptxmac commented Jun 13, 2023

After opening the PulseUI on iOS a LoggerSyncSession is created. This class replaces the WCSession delegate on init, without any regard for an existing delegate.

This will more or less break any iOS app that has a companion Watch app.

A better solution would be to either:

  • Force the user to explicitly check for file transfers and forward any pulse files to LoggerSyncSession
  • Keep the original WCSession delegate and forward all calls unless it's something only Pulse cares about
@kean kean added the bug Something isn't working label Jun 13, 2023
@kean
Copy link
Owner

kean commented Jun 13, 2023

Good catch. I don't know why it never occurred to me that the delegate was shared 🤦‍♂️

Force the user to explicitly check for file transfers and forward any pulse files to LoggerSyncSession

Can you please elaborate on that?

There is a new ShareLink API in watchOS 9. I wonder if it could replace this feature. It'll also partially cover the lack of remote logging on the physical devices. I originally added WCSession because of the lack of sharing.

@ptxmac
Copy link
Contributor Author

ptxmac commented Jun 13, 2023

Force the user to explicitly check for file transfers and forward any pulse files to LoggerSyncSession

Can you please elaborate on that?

Meaning the developer integrating Pulse is responsible for implementing a WCSession delegate and check if a file transfer is happening.

@kean
Copy link
Owner

kean commented Jun 13, 2023

Ah, got it. Yeah, that makes the most sense. But I'm not sure if it's worth keeping this feature given that the ShareLink now exists. Yes, it's going to require slightly more steps, but it'll work on any platform.

Btw, in addition to Pulse for Mac, there is also a new Pulse app coming for iOS. It'll allow you opening Pulse log files on the iOS devices. I haven't pushed it to TestFlight yet.

@ptxmac
Copy link
Contributor Author

ptxmac commented Jun 13, 2023

Yeah, ShareLink does sound like a fair solution, except that It's WatchOS 9 only...
Personally, I always support at least one version back. From my statistics, I still have 6% of users on WatchOS 7!

@kean
Copy link
Owner

kean commented Jun 17, 2023

I've done a couple of (successful) prototypes, and I'm planning to:

  • Remove WCSession activation code from the framework
  • Add metadata to WCSessionFile and ask the user to send it to LoggerStore manually in case it's from Pulse
  • Bring the existing ShareView from iOS to watchOS and use ShareLink internally

This will not be too much work from the user's point of view and will address the issues you highlighted. Once again, thank you for testing it and reporting the detailed issues. I really appreciate it!

@kean
Copy link
Owner

kean commented Jun 18, 2023

Fixed in 4.0.0-beta.3.

@kean kean closed this as completed Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants