Skip to content

feat: record app and APNs environment on user devices - #276

Merged
roncodes merged 1 commit into
release/v1.6.65from
feat/user-device-push-metadata
Sep 28, 2026
Merged

roncodes merged 1 commit into
release/v1.6.65from
feat/user-device-push-metadata

Conversation

@roncodes

Copy link
Copy Markdown
Member

Summary

Adds three optional, nullable columns to user_devices, and makes them fillable on UserDevice:

Column Purpose
app_identifier (indexed) uuid of the app owner (e.g. a Storefront store or network) the token was registered through, so senders pick that app's push credentials first
environment APNs environment that issued an iOS token (production / sandbox), so it is sent to the right APNs host instead of being rejected with BadDeviceToken
last_seen_at when the device last re-registered its token

This supports the Storefront push notification fix (fleetbase/storefront fix/push-notification-layer). Storefront only writes these columns when they exist, so the two PRs can ship in either order.

Validation

  • The migration guards every column with Schema::hasColumn; down() drops only existing columns.
  • php -l passes on both files, and the PHP formatter (php-cs-fixer --dry-run) reports 0 changes.
  • No behavior change for existing callers: all columns are nullable, and no existing code reads them.

Risk

Low. This adds nullable columns to user_devices; existing reads and writes are unchanged.

Add optional app_identifier, environment and last_seen_at columns to
user_devices so push senders can pick the credentials of the app a token
was registered from and the APNs environment that issued it, instead of
guessing. All columns are nullable and guarded, and callers that do not
set them keep working.
@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3965998) to head (5ded447).

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #276   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity      7499      7499           
===========================================
  Files            430       430           
  Lines          24488     24488           
===========================================
  Hits           24488     24488           
Flag Coverage Δ
backend 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

This was referenced Sep 28, 2026
@roncodes
roncodes changed the base branch from main to release/v1.6.65 September 28, 2026 03:28
@roncodes
roncodes merged commit 3f7bb9f into release/v1.6.65 Sep 28, 2026
7 checks passed
@roncodes
roncodes deleted the feat/user-device-push-metadata branch September 28, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant