fleet/server/mdm/android
Victor Lyuboslavsky c378e27d82
Fixed Android pubsub panic when host was deleted (#43788)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #42494 

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Prevented a server panic (HTTP 502) when Android pubsub status reports
arrive for hosts deleted from Fleet by validating re-enrollment before
processing.
* Improved Android host creation to avoid creating duplicate hosts when
an Orbit-only enrollment already exists.

* **Tests**
* Added unit tests for the re-enrollment flow for deleted hosts and
deduplication between Orbit and Android enrollments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-21 16:01:51 -05:00
..
mock Android WebApps: endpoint to create one, prevent android app configuration on webApps (#40329) 2026-03-02 15:14:19 -05:00
service Fixed Android pubsub panic when host was deleted (#43788) 2026-04-21 16:01:51 -05:00
tests Converted old activity module into function. Cleaned up activity types. (#40752) 2026-03-03 01:01:42 -06:00
android.go Add support for fully-managed android devices (#39388) 2026-02-06 10:46:25 -05:00
arch_test.go Converted old activity module into function. Cleaned up activity types. (#40752) 2026-03-03 01:01:42 -06:00
datastore.go Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
errors.go Hook up Android fleetdm.com/proxy (#29645) 2025-06-12 19:42:15 -05:00
onc.go Android Wi-Fi profile withheld until cert installed on device (#42877) 2026-04-07 16:26:09 -05:00
onc_test.go Android Wi-Fi profile withheld until cert installed on device (#42877) 2026-04-07 16:26:09 -05:00
pubsub.go Added custom auth for PubSub push endpoint. (#26664) 2025-02-27 15:16:32 -06:00
README.md Basic Android enroll functionality (#26386) 2025-02-24 14:31:21 -06:00
service.go Android WebApps: endpoint to create one, prevent android app configuration on webApps (#40329) 2026-03-02 15:14:19 -05:00

The MDM Android package attempts to decouple Android-specific service and datastore implementations from the core Fleet server code.

Any tightly coupled code that needs both the core Fleet server and the Android-specific features must live in the main server/fleet, server/service, and server/datastore packages. Typical example are MySQL queries. Any code that implements Android-specific functionality should live in the server/mdm/android package. For example, the common code from server/datastore package can call the android datastore methods as needed.

This decoupled approach attempts to achieve the following goals:

  • Easier to understand and find Android-specific code.
  • Easier to fix Android-specific bugs and add new features.
  • Easier to maintain Android-specific feature branches.
  • Faster Android-specific tests, including ability to run all tests in parallel.