Skip to content

Fine tuning Live Activity implementation#4696

Open
bgoncal wants to merge 8 commits into
mainfrom
live-activity-last-mile
Open

Fine tuning Live Activity implementation#4696
bgoncal wants to merge 8 commits into
mainfrom
live-activity-last-mile

Conversation

@bgoncal

@bgoncal bgoncal commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Live Activity data model translation updates, including support for dynamic title content.
  • Provide per-activity push token TTL/expiry metadata to Home Assistant core via expires_at.
  • Normalize expires_at to whole-second epoch values to keep the webhook contract stable and avoid fractional timestamp inconsistencies.
  • Align Live Activity contract test expectations with the intentional shipped Keychain key (live_activity_token) to keep the test contract consistent with production behavior.

Screenshots

N/A (no user-facing UI changes in this follow-up adjustment)

Link to pull request in Documentation repository

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

Any other notes

CC @rwarner

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fine-tunes the Live Activity implementation by extending the Live Activity content model to support a dynamically updateable title, and by reporting a per-activity push token expiration timestamp back to Home Assistant core.

Changes:

  • Add title to HALiveActivityAttributes.ContentState and plumb it through notification payload parsing and Live Activity UI rendering.
  • Extend the per-activity push token webhook payload with an expires_at field and freeze the TTL contract in tests.
  • Add a DEBUG-only switch to optionally disable local push handling during Live Activity testing.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Tests/Shared/LiveActivity/LiveActivityContractTests.swift Updates wire-format contract tests for new title key and expires_at/TTL assertions.
Tests/Shared/LiveActivity/HandlerLiveActivityTests.swift Extends handler tests to validate parsing of the new title field.
Sources/Shared/Notifications/NotificationCommands/HandlerLiveActivity.swift Parses title into the dynamic Live Activity content state.
Sources/Shared/LiveActivity/LiveActivityRegistry.swift Adds expires_at reporting for push tokens and defines TTL contract constant.
Sources/Shared/LiveActivity/HALiveActivityAttributes.swift Adds title to ContentState with explicit CodingKeys + Codable support.
Sources/Extensions/Widgets/LiveActivity/HALockScreenView.swift Uses dynamic state.title when present, falling back to attributes title.
Sources/Extensions/Widgets/LiveActivity/HADynamicIslandView.swift Uses dynamic state.title when present, falling back to attributes title.
Sources/App/Notifications/NotificationManager.swift Adds DEBUG-only toggle to force-disallow local push interface for testing.

Comment thread Sources/Shared/LiveActivity/LiveActivityRegistry.swift Outdated
Comment thread Tests/Shared/LiveActivity/LiveActivityContractTests.swift
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d5785e5). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #4696   +/-   ##
======================================
  Coverage        ?       0           
======================================
  Files           ?       0           
  Lines           ?       0           
  Branches        ?       0           
======================================
  Hits            ?       0           
  Misses          ?       0           
  Partials        ?       0           

☔ 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.

Copilot AI changed the title Fine tuning live activity implementation Fine tuning Live Activity implementation Jun 3, 2026
@bgoncal bgoncal marked this pull request as ready for review June 4, 2026 22:30
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.

3 participants