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 batch deleting current user while it has muted users attached to it #3507

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

laevandus
Copy link
Contributor

@laevandus laevandus commented Nov 25, 2024

🎯 Goal

Describe why we are making this change.

📝 Summary

CurrentUserDTO.mutedUsers's deletion rule was changed from cascade to nullify. This in turn requires that relationships have the optional check enabled in the model, which we did not have the deletion rule change. This triggered the error.

🛠 Implementation

[ChatClient.swift:496] [logout(completion:)] > Logging out current user failed with error Error Domain=NSCocoaErrorDomain Code=134050 "Constraint trigger violation: Batch delete failed due to mandatory MTM nullify inverse on CurrentUserDTO/mutedUsers" UserInfo={NSExceptionOmitCallstacks=true, NSLocalizedFailureReason=Constraint trigger violation: Batch delete failed due to mandatory MTM nullify inverse on CurrentUserDTO/mutedUsers, _NSCoreDataOptimisticLockingFailureConflictsKey=( )}

🎨 Showcase

Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.

Before After
img img

🧪 Manual Testing Notes

Explain how this change can be tested manually, if applicable.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

🎁 Meme

Provide a funny gif or image that relates to your work on this pull request. (Optional)

@laevandus laevandus added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Nov 25, 2024
@laevandus laevandus requested a review from a team as a code owner November 25, 2024 13:05
Copy link

github-actions bot commented Nov 25, 2024

1 Message
📖 There seems to be app changes but CHANGELOG wasn't modified.
Please include an entry if the PR includes user-facing changes.
You can find it at CHANGELOG.md.

Generated by 🚫 Danger

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChat 7.06 MB 7.06 MB 0 KB 🟢
StreamChatUI 4.96 MB 4.96 MB 0 KB 🟢

@laevandus laevandus force-pushed the fix/muted-users-core-data-error branch from 61718e4 to 292062d Compare November 25, 2024 13:12
@Stream-SDK-Bot
Copy link
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 3.34 ms 66.6% 🔼 🟢
Duration 2.6 s 2.54 s 2.31% 🔼 🟢
Hitch time ratio 4 ms per s 1.31 ms per s 67.25% 🔼 🟢
Frame rate 75 fps 78.66 fps 4.88% 🔼 🟢
Number of hitches 1 0.4 60.0% 🔼 🟢

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChat 7.06 MB 7.06 MB 0 KB 🟢
StreamChatUI 4.96 MB 4.96 MB 0 KB 🟢

@laevandus laevandus enabled auto-merge (squash) November 25, 2024 13:30
Copy link

sonarcloud bot commented Nov 25, 2024

@laevandus laevandus merged commit 8b80d3f into develop Nov 25, 2024
13 checks passed
@laevandus laevandus deleted the fix/muted-users-core-data-error branch November 25, 2024 14:07
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