protocolbuffers / protocolbuffers/protobuf
[Ruby FFI] Map#merge always raises when merging Hash or Map values
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 72k
- Forks
- 16.3k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 140
Description
Summary
The FFI implementation of Google::Protobuf::Map#merge calls private helpers with explicit receivers. Ruby rejects both calls: Map input reaches other.descriptor, and all accepted inputs reach internal_dup.internal_merge_into_self, producing NoMethodError instead of a merged copy.
Proposed correction
Use the existing private reflective access consistently for descriptor and internal_merge_into_self. Candidate: 00c482150dab1ad152135ab860632c8ae2a11c26 on current main (5b1c20741838b8359193b97895cb0ff35b4ecf79).
The isolated source-built FFI model covers Hash and compatible Map merges, result independence, and unchanged inputs. The cumulative source-built FFI suite passes 329 tests /598,403 assertions with no failures/errors and nine documented omissions; native passes 332 /556,948 with three omissions.
I used an AI coding assistant during source review and verification. I am opening an issue first because CONTRIBUTING asks for tests and maintainer agreement; this dependency audit is not permitted to modify repository tests and no CLA was signed as part of it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Ruby FFI implementation of Google::Protobuf::Map#merge and inspect its private helper calls, especially descriptor and internal_merge_into_self. Use the isolated source-built FFI model to verify Hash and compatible Map merges, result independence, and unchanged inputs, then confirm the reported source-built and native suite results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100