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

Fix parsing member field in notification.removed_from_channel event #2259

Merged
merged 6 commits into from
Aug 31, 2022

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Aug 30, 2022

🔗 Issue Links

#2251

🎯 Goal

In the notification.removed_from_channel event, the user field is not present inside the member field, although the user_id is. This PR adds a fallback so that if the user is not present, we use the id from the user_id property.

The backend will change this meanwhile, and make sure the user field is always present. But since we don't have an ETA for this, it makes sense to add this fallback.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • This change follows zero ⚠️ policy (required)
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

@nuno-vieira nuno-vieira added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Aug 30, 2022
@nuno-vieira nuno-vieira requested a review from a team as a code owner August 30, 2022 16:47
@nuno-vieira nuno-vieira changed the title Fix parsing member field in notification.removed_from_channel event Fix parsing member field in notification.removed_from_channel event Aug 30, 2022
Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@sonarcloud
Copy link

sonarcloud bot commented Aug 31, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

97.1% 97.1% Coverage
12.2% 12.2% Duplication

Copy link
Contributor

@polqf polqf left a comment

Choose a reason for hiding this comment

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

The only comment I would add is that we should be using optionals instead of unwrapped values in tests

@nuno-vieira
Copy link
Member Author

@polqf That will take some time to change. Besides that, most of the tests are performing against optional values, so if we just use the optional value on the actuals, there's a chance of having false positives, if both are nil

@nuno-vieira nuno-vieira merged commit 1efb8f0 into develop Aug 31, 2022
@nuno-vieira nuno-vieira deleted the fix/error-parsing-removed-from-channel-event branch August 31, 2022 14:12
@polqf polqf mentioned this pull request Sep 1, 2022
polqf pushed a commit that referenced this pull request Sep 1, 2022
…nt (#2259)

* Fix parsing the member in "notification.removed_from_channel" event

* Add test coverage

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants