Conversation
adapters/beop/beop.go
Outdated
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
adapters/beop/beop.go
Outdated
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
adapters/beop/beop.go
Outdated
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
adapters/beop/beop.go
Outdated
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
01c5ff6 to
7f08f47
Compare
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
| continue | ||
| } | ||
| bidResponseFinal.Bids = append(bidResponseFinal.Bids, &adapters.TypedBid{ | ||
| Bid: &bid, |
There was a problem hiding this comment.
Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below
for _, seatBid := range response.SeatBid {
for i := range seatBids.Bid {
...
responseBid := &adapters.TypedBid{
Bid: &seatBids.Bid[i],
...
}
...
...
}
}
| var bidExt openrtb_ext.ExtBid | ||
| err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
| if err == nil && bidExt.Prebid != nil { | ||
| return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type)) |
There was a problem hiding this comment.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
beopRefer here for heat map coverage report |
|
I'm closing this PR as I see you recently opened #4660. |
No description provided.