refactor(node): fetch device links from the API, drop the bundled matcher#5765
Merged
Conversation
…cher
Replace the bundled urls.json + marketplaces.json and the client-side DeviceLinkMatcher heuristic with a fetch of the now-live /resource/deviceLinks endpoint, which returns fully-resolved links (type, targets, regions). The client seeds from a bundled snapshot, refreshes from the network, and filters the cache - mirroring the DeviceHardware repository pattern.
- core/model: NetworkDeviceLink DTOs; DeviceLink drops originalUrl, adds targets
- core/network: ApiService.getDeviceLinks() + DeviceLinksRemoteDataSource
- core/database: device_link drops original_url, adds targets; DB v42 -> v43
- core/data: rewrite DeviceLinkRepositoryImpl (seed -> single-flight refresh); delete DeviceLinkMatcher + the MshTo datasource/model
- assets: replace urls.json + marketplaces.json with a device_links.json snapshot
Internal links are excluded from the directory per the API contract ("clients exclude 'internal' from purchase UI"). F-Droid and desktop fall back to the bundled snapshot when the API is unavailable, as they do for device hardware.
Follow-up to #5714; depends on meshtastic/api#94 and meshtastic/msh.to#3 (both merged).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9c686a7 to
7683b91
Compare
jamesarich
added a commit
that referenced
this pull request
Jun 10, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
that referenced
this pull request
Jun 10, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
that referenced
this pull request
Jun 12, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
that referenced
this pull request
Jun 13, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
that referenced
this pull request
Jun 16, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
that referenced
this pull request
Jun 16, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jamesarich
added a commit
that referenced
this pull request
Jun 16, 2026
…cher (#5765) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The device-links API is now live, so this reworks the "I want one" feature (#5714) to fetch resolved links from
GET /resource/deviceLinksinstead of bundlingurls.json+marketplaces.jsonand matching them client-side.The server now does all the classification (
type/targets/regions), so the entireDeviceLinkMatcherheuristic — prefix/suffix parsing, therak-strip, themarketplaces.jsonregion map — is deleted. The client seeds from a bundled snapshot, refreshes from the network, and filters the cache, mirroring the existingDeviceHardwareRepositorypattern.Depends on (both merged): meshtastic/api#94 (the endpoint + hourly sync) and meshtastic/msh.to#3 (the
Type/Targetsmodel + lint ratchet).How
NetworkDeviceLink/NetworkDeviceLinksResponseDTOs +toDeviceLink().DeviceLinkdropsoriginalUrl, addstargets.MshToLinksdeleted.ApiService.getDeviceLinks()+DeviceLinksRemoteDataSource.device_linkdropsoriginal_url, addstargets. DB v42 → v43 (AutoMigration42to43@DeleteColumn original_url;targetsauto-added, nullable).DeviceLinkRepositoryImpl(seed-if-empty → single-flight TTL refresh). DeletedDeviceLinkMatcher+MshToLinksJsonDataSource; newDeviceLinksJsonDataSourceseed loader.urls.json+marketplaces.json→ a singledevice_links.jsonsnapshot of the API response.Filtering is now trivial:
platformioTarget ∈ targets&& region && vendor-first. The UI (DeviceLinksSection, directory) is unchanged —DeviceLink.isVendor/regions/urlare preserved.Behavior notes
internaland its schema explicitly says clients should exclude them from purchase UI. (Node-detail was already unaffected — internal links carry notargets.)getLinksForTargetnever waits on the network; it serves cache and relies onreconcile()firing during the device-hardware refresh that resolves the node's hardware anyway.device_links.jsonsnapshot, exactly as they do for device hardware.Testing
./gradlew spotlessApply spotlessCheck detekt assembleDebug test allTests kmpSmokeCompile— all green (2,031 tests). Room generated + validated43.json.DeviceLinkRepositoryImplTestrewritten for the network/seed flow.Follow-up to #5714.
🤖 Generated with Claude Code