Skip to content

Show Loop APNS environment as info instead of a toggle - #776

Open
bjorkert wants to merge 1 commit into
devfrom
loop-apns-environment-from-profile
Open

bjorkert wants to merge 1 commit into
devfrom
loop-apns-environment-from-profile

Conversation

@bjorkert

Copy link
Copy Markdown
Member

Loop now uploads isAPNSProduction to the Nightscout profile, same as Trio, and LoopFollow already reads it from there. This removes the manual Production toggle from the Loop APNS settings and shows the current environment under Debug / Info instead, like it is for Trio. The hint in the 400 error message about flipping the toggle is removed too.

Requires a Loop build with LoopKit/NightscoutKit#1 and LoopKit/NightscoutService#25.

The environment is read from the isAPNSProduction value that Loop uploads to the Nightscout profile, so the manual Production toggle is removed from the Loop APNS settings. The current environment is shown under Debug / Info, the same as for Trio.
@bjorkert

Copy link
Copy Markdown
Member Author

Why this is safe for people whose Loop doesn't upload isAPNSProduction yet

LoopFollow only writes the APNS environment when the profile contains isAPNSProduction (ProfileManager.swift). If the field is missing, the stored value is kept, and its default is false (development).

  • Browser/TestFlight Loop builders: they rebuild every 60–90 days, and LoopWorkspace main already includes NightscoutService#25. Their profile will contain the value after their next rebuild.
  • Xcode Loop builders on an older Loop: they need development, which is the default, so remotes keep working.
  • Remaining edge case: someone on an older Xcode-built Loop who has Production turned on in LoopFollow (left over from a browser build, an imported settings file, or a mistake). Remotes already fail for them today. With this PR they can't flip the toggle back, but rebuilding Loop fixes it. The current environment is shown under Debug / Info, which makes this case easy to spot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant