-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update the app expiration alert for GitHub and Xcode builds #2052
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
Conversation
|
This doesn't account for the case where profile expiration is sooner than 90 days. Also hard coding the number of days to 90 might break in the future if apple changes this value on their end. |
|
Thanks @dabear.
Summary:
Results (number of days reported on 2023-Aug-22) :
Details:
|
|
Certificates do expire, and this prevents uploading newly built versions of Loop. The thing that prevents Loop from running on the phone is the provisioning profile, and that expires also. This PR should not be overwriting the profile expiration date with a hardcoded timestamp based off the build date. The build system can check for expiration on certificates, and we could theoretically trigger an auto update of certs and profiles when the expiration is near. |
|
And the date reported in Loop is based off of the provisioning profile expiration date, which may or may not coincide with the certificate expiration date. |
|
I wanted to get this discussion started with something I tested that does modify the notification behavior for a user. I’m happy to make modifications. In addition, I do not think using the directory name of /Users/runner is particularly robust. (See first sentence.) There is also a separate PM discussion about a possible PR for the build process that can create new certs at need - separate topic but wanted to mention it. |
|
The current method of using the provisioning profile expiration date as the warning is the correct date to warn the user about when the app will stop working. |
|
Thanks to @bjorkert for the improved version of
Tested with Mac-Xcode
Tested with GitHub build
|
Hi @ps2, building on the previous work regarding automated builds, @billybooth and I are actually planning on implementing a scheduled action that will check for certificate and/or provisioning profile expiry and renew those automatically. It’s still at a discussion stage, because we are currently working on further validating around common build errors and providing improved, i.e. actionable, error messages to end-users, but it’s on our unofficial to-do list. |
|
The goal of this is to support providing the user a warning about TestFlight build expiration, correct? Github doesn't have anything to do with the app expiration that TestFlight imposes. There are ways to detect a TestFlight build, it appears: https://stackoverflow.com/questions/26081543/how-to-tell-at-runtime-whether-an-ios-app-is-running-through-a-testflight-beta-i I suggest using the above technique to determine whether the build is a TestFlight build in the It's still possible (though unlikely) that the profile may expire before the TestFlight build date, so we should probably consider that. The wording of the messaging to the user should also be updated: Either:
|
|
I also receive the sandboxReceipt as the receipt file for Mac Xcode builds. I'll explore other options, and if needed, I can set a TestFlight flag when the GITHUB_ACTION is set. |
Pete linked to an article in the associated issue #1881:
Definitely seems viable, since it reads the embedded mobileprovision, although perhaps not straightforward as the above suggestion (that doesn't work). As I re-read the stackoverflow answer, it indicates that "sandboxReceipt" is the name of the receipt file for local (Xcode) builds as well, i.e., you'll only get a "receipt" file for an App Store app:
|
|
I tested using my repository with code that matches this PR, up through commit Test Summary:
Test Overview:
Test Details:
Modal Alert comment:
|
|
There was a logic error in the modal alert for expiration (only checked provisioning profile). That was fixed with commit 211a337. Test Modal Alerts as a separate test:
|
|
Thanks to @billybooth for the improved isTestFlightBuild function. |
ps2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. A couple nits; won't hold up merging if you're opposed to the suggestions.
Loop/Views/SettingsView.swift
Outdated
| @@ -417,25 +417,48 @@ extension SettingsView { | |||
| DIY loop specific component to show users the amount of time remaining on their build before a rebuild is necessary. | |||
| */ | |||
| private func profileExpirationSection(profileExpiration:Date) -> some View { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe rename this appExpirationSection
|
Tested - success (see composite) Test details:
|
|
Thanks all! |



The method has been updated several times. Editing this first comment to match current state (because this is the first item most people see).
This PR supplies appropriate expiration information on the Loop Settings screen and the modal alert when expiration nears.
This has been tested for both Mac-Xcode builds and GitHub Builds uploaded through TestFlight.