mirror of
https://github.com/nspcc-dev/neofs-sdk-go.git
synced 2026-03-01 04:29:18 +00:00
CopyTo works incorrectly in some cases #263
Labels
No labels
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U2
U2
U3
U4
blocked
bug
client
config
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
performance
pool
question
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-sdk-go#263
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cthulhu-rider on GitHub (Dec 12, 2024).
CopyTois provided by several complex struct types. It allows to deep-copy instance for safetyCurrent Behavior
Container.CopyTokeepsdstattributes whensrchas none. Ifdstalready had some attributes, resulting copy is incorrectthis could be missed in 2 reasons:
CopyTois rarely useddstis usually zero: np in this caseExpected Behavior
correct deep copy
Possible Solution
just do it
Steps to Reproduce
Context
maybe there are other cases, review all of them. To force this, i suggest to pre-add corresponding unit tests
Regression
no (at least for noticed case)
Your Environment
0b9bb748ea@cthulhu-rider commented on GitHub (Dec 12, 2024):
session.Container/Objecthave similar error inUnmarshal(JSON: context fields aint resetin total, i suggest to add unit tests for resetting a previously set value for the following methods:
CopyToReadFromV2(futureFromProtoMessage)UnmarshalUnmarshalJSONin particular cases, this can be already covered. Example
once all tests are done, some cases incl. mentioned here will FAIL. And then fix