Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databroker: changeset: prevent nil data in the deleted records #4736

Merged
merged 1 commit into from Nov 10, 2023

Conversation

wasaga
Copy link
Contributor

@wasaga wasaga commented Nov 10, 2023

Summary

Prevents Record.Data being nil in the deleted records, by setting it to empty protobuf.Any of desired type.

Related issues

Related: #4733

User Explanation

Checklist

  • reference any related issues
  • updated docs
  • updated unit tests
  • updated UPGRADING.md
  • add appropriate tag (improvement / bug / etc)
  • ready for review

@wasaga wasaga requested a review from a team as a code owner November 10, 2023 19:57
@wasaga wasaga enabled auto-merge (squash) November 10, 2023 19:58
@wasaga wasaga added the bug Something isn't working label Nov 10, 2023
@@ -37,6 +38,7 @@ func (cs *changeSet) Remove(typ string, id string) {
Type: typ,
Id: id,
DeletedAt: cs.now,
Data: &anypb.Any{TypeUrl: typ},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this will do. The data would be nil. It may fail in marshaling and/or unmarshaling.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently it's fine 🤷 .

@coveralls
Copy link

Coverage Status

coverage: 63.887% (-0.02%) from 63.904%
when pulling f1d5bb7 on wasaga/not-nil-data-deleted-records
into 6de9f12 on main.

@wasaga wasaga merged commit 15ca641 into main Nov 10, 2023
8 of 11 checks passed
@wasaga wasaga deleted the wasaga/not-nil-data-deleted-records branch November 10, 2023 20:04
wasaga added a commit that referenced this pull request Nov 10, 2023
databroker: changeset: prevent nil data in the deleted records (#4736)

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 0-24-0 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants