fix(core): use deep copy for committedUids to prevent mutation corruption#9488
fix(core): use deep copy for committedUids to prevent mutation corruption#9488eileenaaa wants to merge 1 commit intodgraph-io:mainfrom
Conversation
|
Any reason for this? From what I understand, the underlying structures wont be changed. Did you notice any issue or just because of linters / safety? |
The change to proto.Clone(post).(*pb.Posting) was made because PR 9480 aims to fix a race condition in the mutation map. |
|
@eileenaaa The reason I didn't do this in that PR was, even though map might get updated, the underlying values don't get updated. This is already committed data which is not going to get updated. Make a proto clone there only adds more memory without really giving us any benefit. Hence I asked did you see any error, which would mean that my theory was wrong. |
|
@harshil-goel I checked the subsequent code and confirmed that committedUids data is indeed not modified afterwards. I also ran tests with concurrent data, and it works fine, so making a deep copy here is not necessary. |
Description
This PR addresses a stability issue in mutation handling:
modifications from corrupting committed state.
These changes make committedUids safer and preserve correctness during refresh.
Checklist
CHANGELOG.mdfile describing and linking tothis PR