Files
ios-client/NetBirdTests
Zoltan PappandClaude Opus 5 ecf3b2a82f Add a Troubleshoot toggle for remote debug bundle jobs (#216)
* Add a Troubleshoot toggle for remote debug bundle jobs

The client refuses management-requested remote jobs unless
RemoteJobsAllowed is enabled, and the iOS and tvOS apps had no way to
turn it on. Expose the flag through ConfigurationProvider, add an
"Allow remote debug bundles" toggle to the iOS Troubleshoot screen and
a Troubleshooting section in the tvOS settings, and bump netbird-core to
the commit that adds the SDK preference accessors.

* Update submodule

* Route the iOS remote jobs toggle through the view model setter

The Toggle wrote the published property before onChange invoked
setRemoteJobsAllowed, so on a failed commit the rollback restored the
new value instead of the previous one. Use a Binding whose setter calls
the view model directly, matching the tvOS settings view.

* Lock the remote debug bundle toggle when MDM manages it (#224)

* Lock the remote debug bundle toggle when MDM manages it

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Decode the remote jobs snapshot key as allowRemoteJobs

The Go snapshot reports this field under the policy key name,
allowRemoteJobs, not remoteJobsAllowed. The synthesized coding key used the
property name, so decodeIfPresent never found the key and the flag stayed
false — the toggle looked editable under an MDM policy that manages it.

Map the coding key explicitly and keep the property name, which the views
already reference. Bumps netbird-core to pick up the matching Go-side fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Bump submodule

* Use allowRemoteJobs key in MDM restriction test fixtures

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Enforce the remote jobs policy before the next poll

setRemoteJobsAllowed validated against the cached MDM snapshot, which is
only refreshed on onAppear or a 30s stale poll. The OS writes managed
configuration from another process, so the in-process change notification
never fires for it and a policy pushed mid-session went unenforced until
the next poll. Refresh the snapshot before validating.

The guard also checked only mdm.remoteJobsAllowed, while both toggles lock
on remoteJobsAllowed || disableUpdateSettings, so the backstop could
disagree with the control the user sees. Extract
remoteJobsForbiddenByPolicy to mirror the lock.

Route the rejection through commitSettings() so an MDM-refused commit
raises the standard alert instead of a silent print. This matters most on
tvOS, where commit() always reports success and the pre-commit guard is
the only backstop.

* Restore the persisted remote jobs setting after the test

testUnmanagedDeviceStillAcceptsTheChange writes through
ConfigurationProvider, which persists into the Go preferences store.
tearDown() only restored the MDM dictionary, so an enabled
remoteJobsAllowed could leak into later tests or a reused test-host
launch. Capture the original value and restore it via defer, which runs
while the device is still unmanaged so the setter is not rejected.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 15:14:26 +02:00
..