Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

@seer-by-sentry seer-by-sentry bot commented Jan 9, 2026

Fixes LAUNCHPAD-6C. The issue was that: Proto3 scalar field aapt.pb.Reference.name lacks presence, causing HasField() to fail when not marked optional.

  • Replaced HasField() calls with direct attribute access for protobuf fields (ref.name, ref.id) in proto_xml.py and proto_xml_drawable_parser.py.
  • Corrected the logical order of resource ID and name lookups in src/launchpad/artifacts/android/resources/proto.py to ensure the correct field is used for retrieval.

This fix was generated by Seer in Sentry, triggered by Hector Dearman. 👁️ Run ID: 8393448

Not quite right? Click here to continue debugging with Seer.

Copy link
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

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

I believe Seer is correct.

The proto looks like this:

message Reference {
  uint32 id = 2;
  string name = 3;
  // [...snip...]
}

HasField may or may not be defined for a field 'foo' depending on if the field has 'implicit presence'.

This varies depending on if the proto format is proto2, proto3, or editions. In proto3 (as this proto) the field has implicit presence unless it is optional. In editions it always has implicit presence.

The name swap also seems clearly correct.

@chromy chromy marked this pull request as ready for review January 9, 2026 12:35
@chromy chromy merged commit 8c98c33 into main Jan 9, 2026
20 checks passed
@chromy chromy deleted the seer/refactor/android-proto-checks branch January 9, 2026 12:57
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.

2 participants