Skip to content

Let the system refresh the Spotlight index - #5658

Open
bgoncal wants to merge 1 commit into
feature/xcode-27-runnersfrom
spotlight-system-reindex
Open

Let the system refresh the Spotlight index#5658
bgoncal wants to merge 1 commit into
feature/xcode-27-runnersfrom
spotlight-system-reindex

Conversation

@bgoncal

@bgoncal bgoncal commented Sep 6, 2026

Copy link
Copy Markdown
Member

AI Policy

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

Summary

Adopts IndexedEntityQuery, new in iOS 27, so the system can ask for a Spotlight refresh instead of waiting for the app.

Today the index is only rebuilt when the local database changes or the app returns to the foreground, so an entry can stay stale until something else happens to trigger a pass. With this, the system asks when it notices the index may be out of date, either for named entities or for everything.

Draft: this needs Xcode 27, and CI is still on 26.4, so its checks will fail until the runner is bumped. Built and verified locally against Xcode 27 beta.

Screenshots

No UI. The only visible effect is Spotlight results being fresher.

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

This started out larger. Adopting the calendar App Schema turned out not to be the annotation change the comment in HACalendarAppEntity predicted: the schema domain is iOS 27, so annotating the entity makes the type iOS 27, which cascades to its query, all three calendar intents and the Spotlight extension, and would put the existing calendar feature out of reach below iOS 27.

Apple's guidance for that case is to add a parallel schema-conforming type rather than restrict the shipped one, which for calendars means a second entity, its query and create/update/delete intents living alongside today's. That is a design decision worth taking on its own, so it is left out here.

@bgoncal
bgoncal force-pushed the spotlight-system-reindex branch from 96d6c59 to 3391acc Compare September 6, 2026 18:24
@bgoncal
bgoncal changed the base branch from main to feature/xcode-27-runners September 6, 2026 18:24
@bgoncal
bgoncal marked this pull request as ready for review September 6, 2026 19:35
Today the index only updates when the database changes or the app returns to
the foreground, so entries can sit stale until something else triggers a pass.
@bgoncal
bgoncal force-pushed the spotlight-system-reindex branch from 3391acc to 0a42bae Compare September 6, 2026 23:14
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.03%. Comparing base (9e03742) to head (0a42bae).

Files with missing lines Patch % Lines
...p/Utilities/Spotlight/SpotlightEntityIndexer.swift 0.00% 9 Missing ⚠️
...ntityAppIntentEntityQuery+IndexedEntityQuery.swift 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature/xcode-27-runners    #5658      +/-   ##
============================================================
- Coverage                     37.35%   37.03%   -0.33%     
============================================================
  Files                          1064     1061       -3     
  Lines                         73885    73819      -66     
============================================================
- Hits                          27603    27337     -266     
- Misses                        46282    46482     +200     
Files with missing lines Coverage Δ
...ntityAppIntentEntityQuery+IndexedEntityQuery.swift 0.00% <0.00%> (ø)
...p/Utilities/Spotlight/SpotlightEntityIndexer.swift 0.00% <0.00%> (ø)

... and 17 files with indirect coverage changes

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant