Skip to content

fix: [SDK-5671] add missing InputGuard.cs.meta to core package - #910

Merged
fadi-george merged 2 commits into
mainfrom
fadi/sdk-5671
Nov 5, 2026
Merged

fadi-george merged 2 commits into
mainfrom
fadi/sdk-5671

Conversation

@fadi-george

@fadi-george fadi-george commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Add the missing InputGuard.cs.meta to the core package and check in CI that every package asset has a .meta.

Details

Motivation

Fixes #909. #901 added com.onesignal.unity.core/Runtime/InputGuard.cs without its .meta. Unity can't write .meta files into installed UPM packages, so it ignored InputGuard.cs, and the Android/iOS packages failed with CS0103: The name 'InputGuard' does not exist. This affects 5.4.1 and later.

The demo didn't catch it because it references the packages with file: paths, which are editable, so Unity generated the .meta locally.

Scope

  • InputGuard.cs.meta was generated by Unity 6000.4.11f1 when it imported examples/demo.
  • validate-unity-distribution.py now checks each package's npm pack --dry-run file list. Every file and folder Unity imports needs a packed .meta with a unique 32-hex guid. Paths Unity ignores (a leading . or a trailing ~) are skipped.
  • cd.yml runs the validator before npm publish.
  • Shipping the fix to customers needs a 5.4.3 release of core, android, and ios, done separately through the release PR.
  • No runtime code changes.

Testing

Manual testing

  • Validator passes on this branch and fails for a missing meta, an empty meta, a duplicate guid, and a package .npmignore of *.meta.
  • Fresh Unity 6000.4.11f1 projects installing the packages by git URL: main fails Android/iOS player compile with CS0103: The name 'InputGuard' does not exist; this branch compiles both.
  • Ran a batchmode import of examples/demo: no compile errors.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

🤖 Generated with Claude Code

Unity ignores assets without a .meta in immutable UPM packages, so
InputGuard was dropped and the Android/iOS packages failed to compile.
Also validate in CI that every package asset ships with a .meta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george requested a review from a team as a code owner November 5, 2026 18:15

@abdulraqeeb33 abdulraqeeb33 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.

The InputGuard meta is the right fix for the missing file, and a tracked script with no meta now fails the validator. Three gaps are still open.

  1. The publish job never runs the validator, and main does not require test. A package-local .gitignore of *.meta also leaves the validator green while npm pack omits the meta.
  2. Any file named {asset}.meta passes, including an empty file or one with no guid. Unity ignores that asset in an immutable package.
  3. core 5.4.1 and 5.4.2 on npm ship InputGuard.cs without the meta, and android and ios 5.4.2 depend on that core. This branch stays on 5.4.2, so publish will skip.

Before publish, validate npm pack --dry-run: every packed asset needs a packed meta with a unique 32-hex guid. Then release a new core, android, and ios version together.

Check the npm pack file list instead of git, require a unique guid in
every .meta, and run the validator in the publish job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george

Copy link
Copy Markdown
Collaborator Author

Thanks, good catches.

  1. Validator now checks the npm pack --dry-run file list per package instead of git, and runs in cd.yml before npm publish. Making test a required check on main needs an admin, I'll ask.
  2. Every packed meta now needs a 32-hex guid that's unique across the packages. Missing, empty, duplicate guid, and .npmignore of *.meta all fail.
  3. Agreed, I'll cut 5.4.3 for core, android, and ios through the normal release PR after this merges.

@abdulraqeeb33 abdulraqeeb33 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.

The three gaps from the last review are fixed. Pack listing, guid checks, and the publish job all fail closed on the cases that dropped InputGuard. Approving.

Nits, not blockers: require a single guid line and accept A-F, check packed metas that have no asset, and add a fixture so CI fails if this script is weakened. 5.4.1 and 5.4.2 on npm stay broken until the 5.4.3 release.

@fadi-george
fadi-george merged commit 42693f7 into main Nov 5, 2026
1 check passed
@fadi-george
fadi-george deleted the fadi/sdk-5671 branch November 5, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: UPM package is missing InputGuard.cs.meta, causing compilation errors

2 participants