Skip to content

fix(view): preserve packed closed-enum unknowns#252

Open
ogarciarevett wants to merge 1 commit into
anthropics:mainfrom
ogarciarevett:fix/view-packed-closed-enum-unknowns
Open

fix(view): preserve packed closed-enum unknowns#252
ogarciarevett wants to merge 1 commit into
anthropics:mainfrom
ogarciarevett:fix/view-packed-closed-enum-unknowns

Conversation

@ogarciarevett

Copy link
Copy Markdown
Contributor

Closed proto2 enums already preserve unknown values on the owned path, but the packed repeated view path was still dropping them.

This keeps those packed unknown values by letting UnknownFieldsView hold synthetic unknown fields for cases where there is no borrowable per-element wire span.

I also added a regression test for the packed repeated view case and removed the corresponding item from the README limitations list.

Proof:

  • RED on main in a clean worktree: cargo test -p buffa-test 'tests::closed_enum::test_view_closed_enum_repeated_packed_unknown_preserved' -- --exact
  • GREEN here: cargo test -p buffa-test 'tests::closed_enum::test_view_closed_enum_repeated_packed_unknown_preserved' -- --exact
  • Runtime coverage: cargo test -p buffa 'view::tests::unknown_fields_view_to_owned_includes_owned_fields' -- --exact
  • Broader validation: cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace

@github-actions

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

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.

1 participant