fix: RPC event serialization error, dont send empty messages#1871
fix: RPC event serialization error, dont send empty messages#1871toddbaert merged 1 commit intoopen-feature:mainfrom
Conversation
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
Summary of ChangesHello @karel1980, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug where the flag evaluation service could panic if a notification's data payload was Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses a bug in notification sending by ensuring the data structure is correctly typed before protobuf conversion. The inclusion of a new test case to validate the fix is a great example of test-driven development. Additionally, the changes improve the robustness of the event stream handling by preventing potential panics from nil data and refining error management. I've included a couple of minor suggestions to enhance code readability in the event stream handlers.
|
Changed the PR title (conventional commit) |
21a5fbe to
21f04d3
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request fixes an error that occurred when sending notifications, by ensuring the notification data is a plain map[string]interface{} which is compatible with protobuf serialization. The change is correct and is accompanied by a regression test. I've added a couple of suggestions to further improve the code: one to avoid sending empty notifications, and another to improve test reliability by avoiding time.Sleep.
07ea2ab to
90bde21
Compare
|
@karel1980 I made a change here to avoid sending empty notification messages entirely. If no flags are changed, there doesn't seem to be a point. I don't think this happens much in prod scenarios, to be honest. |
We no longer send notifications which are empty. Signed-off-by: Karel Vervaeke <karel@vervaeke.info>
90bde21 to
c8b1e4d
Compare
|
🤖 I have created a release *beep* *boop* --- <details><summary>flagd: 0.14.1</summary> ## [0.14.1](flagd/v0.14.0...flagd/v0.14.1) (2026-03-04) ### 🐛 Bug Fixes * RPC event serialization error, dont send empty messages ([#1871](#1871)) ([95d38fd](95d38fd)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>


This PR
Related Issues
None that I'm aware of
Notes
vibe coding warning: I don't know go well enough to fix this, but I did use TDD and also did a manual test to verify that my problem went away.
If any part of my solution is technicaly or doesn't fit in the codebase for any reason: feel free to comment, I'll do my best to improve it.
How to test
Running the test suite should be sufficient